private int Run(IPencilOptions options, IProject project) { var fileSystem = LocalFileSystem.Instance; var platform = new ExecutionEnvironment(logger); project.Register(fileSystem); project.Register<IExecutionEnvironment>(platform); ProjectContext.FileSystem = fileSystem; ProjectContext.ExecutionEnvironment = platform; var buildFilePath = fileSystem.GetFile(options.BuildScript).Parent.Path.ToString(); using (Pushd(buildFilePath, platform)) return Run(options.Targets, project); }