Skip to content

Commit

Permalink
Allows to upload a file using a relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
ecampidoglio committed Jan 9, 2017
1 parent 3491362 commit 5476eb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Cake.Curl.Tests/CurlUploadFileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void Should_Find_Curl_Runner_If_Tool_Path_Not_Provided()
}

[Fact]
public void Should_Set_The_Path_Of_The_File_To_Upload_In_Quotes_As_Argument()
public void Should_Set_The_Absolute_Path_Of_The_File_To_Upload_In_Quotes_As_Argument()
{
// Given
var fixture = new CurlUploadFileFixture
Expand All @@ -140,7 +140,7 @@ public void Should_Set_The_Path_Of_The_File_To_Upload_In_Quotes_As_Argument()
var result = fixture.Run();

// Then
Assert.Contains("--upload-file \"file/to/upload\"", result.Args);
Assert.Contains("--upload-file \"/Working/file/to/upload\"", result.Args);
}

[Fact]
Expand Down
5 changes: 4 additions & 1 deletion src/Cake.Curl/CurlUploadRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ private ProcessArgumentBuilder GetArguments(
var arguments = new ProcessArgumentBuilder();
arguments.AppendSettings(settings);

arguments.AppendSwitchQuoted("--upload-file", filePath.FullPath);
arguments.AppendSwitchQuoted(
"--upload-file",
filePath.MakeAbsolute(_environment).FullPath);

arguments.AppendSwitch("--url", host.AbsoluteUri);

return arguments;
Expand Down

0 comments on commit 5476eb2

Please sign in to comment.