Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Commit

Permalink
Indicate the beginning of executed scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengTian committed May 23, 2015
1 parent 2ff6da1 commit 0d033fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public BuildManager(IServiceProvider hostServices, BuildOptions buildOptions)

_applicationEnvironment = (IApplicationEnvironment)hostServices.GetService(typeof(IApplicationEnvironment));

ScriptExecutor = new ScriptExecutor();
ScriptExecutor = new ScriptExecutor(buildOptions.Reports.Information);
}

public ScriptExecutor ScriptExecutor { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public PublishManager(IServiceProvider hostServices, PublishOptions options)

var outputDir = _options.OutputDir ?? Path.Combine(_options.ProjectDir, "bin", "output");
_options.OutputDir = Normalize(outputDir);
ScriptExecutor = new ScriptExecutor();
ScriptExecutor = new ScriptExecutor(_options.Reports.Information);
}

public ScriptExecutor ScriptExecutor { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public RestoreCommand(FrameworkName fallbackFramework)

public async Task<bool> Execute()
{
ScriptExecutor.Report = Reports.Information;

if (!RestoreDirectories.Any())
{
RestoreDirectories.Add(Directory.GetCurrentDirectory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ public class ScriptExecutor
{
private static readonly string ErrorMessageTemplate = "The '{0}' script failed with status code {1}.";

public ScriptExecutor(IReport report = null)
{
Report = report;
}

public IReport Report { get; set; }

public bool Execute(Runtime.Project project, string scriptName, Func<string, string> getVariable)
{
IEnumerable<string> scriptCommandLines;
Expand All @@ -23,6 +30,8 @@ public bool Execute(Runtime.Project project, string scriptName, Func<string, str
return true;
}

Report?.WriteLine($"Executing script '{scriptName}' in {Runtime.Project.ProjectFileName}");

foreach (var scriptCommandLine in scriptCommandLines)
{
var scriptArguments = CommandGrammar.Process(
Expand Down

0 comments on commit 0d033fd

Please sign in to comment.