Skip to content

Commit

Permalink
removes gulp.js check - it screws with working directory setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Philo committed Aug 11, 2016
1 parent 0d9f20c commit 2c28475
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
13 changes: 7 additions & 6 deletions src/Cake.Gulp.Tests/GulpLocalRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ public GulpLocalRunnerTests()
{
this._fixture = new GulpLocalRunnerFixture();
this._gulpFile = "gulpfile.js";
const string pathToGulpJs = "/Working/node_modules/gulp/bin/gulp.js";
const string pathToGulpJs = "node_modules/gulp/bin/gulp.js";
this._fixture.FileSystem.CreateFile(pathToGulpJs);
this._fixture.FileSystem.CreateFile("/abc");
this._fixture.FileSystem.CreateFile("/Working/" +pathToGulpJs);
this._fixture.FileSystem.CreateFile("/abc");
this._fixture.FileSystem.CreateFile(this._gulpFile);
this._fixture.FileSystem.CreateFile("/Working/path-to-gulp/gulp.js");
this._fixture.FileSystem.CreateFile("path-to-gulp/gulp.js");
}

[Fact]
Expand All @@ -25,7 +26,7 @@ public void Install_Settings_With_Gulp_File_Should_Add_Gulpfile_Argument()

var result = this._fixture.Run();

result.Args.ShouldBe("\"/Working/node_modules/gulp/bin/gulp.js\" --gulpfile \"gulpfile.js\"");
result.Args.ShouldBe("\"node_modules/gulp/bin/gulp.js\" --gulpfile \"gulpfile.js\"");
}

[Fact]
Expand All @@ -35,7 +36,7 @@ public void No_Install_Settings_Specified_Should_Execute_Command_Without_Argumen

var result = this._fixture.Run();

result.Args.ShouldBe("\"/Working/node_modules/gulp/bin/gulp.js\"");
result.Args.ShouldBe("\"node_modules/gulp/bin/gulp.js\"");
}

[Fact]
Expand All @@ -44,7 +45,7 @@ public void Custom_Gulp_Path()
this._fixture.InstallSettings = s => s.SetPathToGulpJs("path-to-gulp/gulp.js");
var result = this._fixture.Run();

result.Args.ShouldBe("\"/Working/path-to-gulp/gulp.js\"");
result.Args.ShouldBe("\"path-to-gulp/gulp.js\"");
}
}
}
7 changes: 1 addition & 6 deletions src/Cake.Gulp/GulpLocalRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,8 @@ public override void Execute(Action<GulpLocalRunnerSettings> configure = null)
configure?.Invoke(settings);
ValidateSettings(settings);

var workingDir = GetWorkingDirectory(settings);

var gulpJsPath = FilePath.FromString(workingDir +"/" + settings.PathToGulpJs);
if (!_fileSystem.Exist(gulpJsPath)) throw new FileNotFoundException($"unable to find local gulp installation at specified path [{gulpJsPath}], have you run 'npm install gulp'?");

var args = new ProcessArgumentBuilder();
args.AppendQuoted(gulpJsPath.ToString());
args.AppendQuoted(settings.PathToGulpJs.ToString());
settings.Evaluate(args);

Run(settings, args);
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Gulp/GulpLocalRunnerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class GulpLocalRunnerSettings : GulpRunnerSettings
/// <summary>
/// Path to node modules
/// </summary>
public FilePath PathToGulpJs { get; private set; } = "./node_modules/gulp/bin/gulp.js";
public FilePath PathToGulpJs { get; private set; } = "node_modules/gulp/bin/gulp.js";

/// <summary>
/// Overrides the default path to gulp javascript, the current working directory will be prepended to this path
Expand Down

0 comments on commit 2c28475

Please sign in to comment.