Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is -e for setting environment variables still required? #1866

Closed
stmax82 opened this issue Apr 13, 2018 · 1 comment
Closed

Is -e for setting environment variables still required? #1866

stmax82 opened this issue Apr 13, 2018 · 1 comment

Comments

@stmax82
Copy link

stmax82 commented Apr 13, 2018

The -e switch for passing variables to the fake build script seems to be broken in fake 5.0.0-rc004. It works fine with 5.0.0-beta029.

The following script reads and prints the variable "foo":

#r "paket:
nuget Fake.Core.Target //"
#load "./.fake/build.fsx/intellisense.fsx"

open Fake.Core

open Environment

Target.create "Build" (fun _ ->
  let foo = environVarOrFail "foo"

  Trace.logfn "foo: %s" foo
)

Target.runOrDefault "Build"

Running fake build -e foo 42 results in the error "Environment variable 'foo' not found":

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target     Duration
------     --------
Build      00:00:00.0005086   (Environment variable 'foo' not found)
Total:     00:00:00.0321655
Status:    Failure
---------------------------------------------------------------------
-> BuildFailedException: Target 'Build' failed.
-> One or more errors occurred. (Environment variable 'foo' not found)
-> Environment variable 'foo' not found

Install fake 5.0.0-beta029 and it works, fake 5.0.0-rc004 doesn't work.

Tested on Win 10 x64.

@matthid
Copy link
Member

matthid commented Apr 13, 2018

Sorry, yes this was kind of broken on purpose (more or less).
I'm not sure if this should be removed or kept. Did you look into the new feature of providing arguments to the build script natively:

@matthid matthid changed the title fake -e is broken in latest fake (5.0.0-rc004) Is -e for setting environment variables still required? Apr 13, 2018
kblohm pushed a commit to kblohm/FAKE that referenced this issue Apr 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants