cake-build / resources

Contains different kind of resources such as bootstrappers and configuration files.
MIT License
54 stars 79 forks source link

Update build.sh to accept quoted parameters #97

Closed rollenes closed 3 years ago

rollenes commented 3 years ago

We get into errors when using origianl build.sh from https://cakebuild.net/docs/running-builds/runners/dotnet-tool#getting-the-bootstrapper

build.cake

Task("TestArg").Does(() => { Information(Argument<string>("quoted")); });

Running: $ ./build.sh --target=TestArg --quoted="test test"

Before fix:

Restore was successful.
+ dotnet cake --target=TestArg --quoted=test test
Error: Bootstrapping failed for '/home/rwartalski/esky-hapi-service/test'.
test, line #0: Could not find script '/home/rwartalski/esky-hapi-service/test'.

After fix:

========================================
TestArg
========================================
test test
augustoproiete commented 3 years ago

Tested on OSX and can repro issue with quoted args and confirm PR fixes it.

Tested with dotnet-args and dotnet-cake:

dotnet-args

Before PR

image

After PR

image


dotnet-cake

Before PR

image

After PR

image


mkdir repro
cd repro
dotnet new tool-manifest --force
dotnet tool install Cake.Tool --version 1.0.0-rc0002
dotnet tool install dotnet-args --version 1.0.0
curl -Lsfo build.sh https://cakebuild.net/download/bootstrapper/dotnet-tool/osx

build.cake

Task("TestArg").Does(() =>
{
    Information("Hello!");
    Information(Argument<string>("quoted"));
    Information("Bye!");
});

RunTarget(Argument<string>("target"));
gep13 commented 3 years ago

@rollenes your changes have been merged, thanks for your contribution 👍