Skip to content

Commit

Permalink
Merge pull request #508 from bentayloruk/fix-fsiargs
Browse files Browse the repository at this point in the history
Provide env var access to --fsiargs build script args so works on FAKE 3
  • Loading branch information
forki committed Jul 29, 2014
2 parents 86fbc30 + f7d708e commit f8745e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions help/commandline.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Important: If you use this option, you must include your build script path as o

`--fsiargs --debug+ buildscript.fsx someArg1 anotherArg2`

The entire argument string *following* the build script path is set as the value of an environment variable named `fsiargs-buildscriptargs`. This means you can access this specific set of arguments from within your build script.

### `--boot [-b] <string>`

Boostrapp your FAKE script. A bootstrapping `build.fsx` script executes twice (in two stages), allowing you to download dependencies with NuGet and do other preparatory work in the first stage, and have these dependencies available in the second stage.
Expand Down
5 changes: 4 additions & 1 deletion src/app/FakeLib/FSIHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ let runBuildScriptWithFsiArgsAt workingDirectory printDetails (FsiArgs(fsiOption
for (k,v) in args do
Environment.SetEnvironmentVariable(k, v, EnvironmentVariableTarget.Process)

// Create an env var that only contains the build script args part from the --fsiargs (or "").
Environment.SetEnvironmentVariable("fsiargs-buildscriptargs", String.Join(" ", scriptArgs))

let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration()

let commonOptions =
[ "fsi.exe"; "--noninteractive" ] @ fsiOptions @ scriptArgs
[ "fsi.exe"; "--noninteractive" ] @ fsiOptions
|> List.toArray

let sbOut = new Text.StringBuilder()
Expand Down

0 comments on commit f8745e4

Please sign in to comment.