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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

make spago run write a JS file and execute it #297

Merged
merged 2 commits into from Jun 27, 2019

Conversation

@justinwoo
Copy link
Collaborator

commented Jun 26, 2019

Description of the change

Fixes #295

Checklist:

  • Added the change to the "Unreleased" section of the changelog
  • Added some example of the new feature to the README
  • Added a test for the contribution (if applicable)

P.S.: the above checks are not compulsory to get a change merged, so you may skip them. However, taking care of them will result in less work for the maintainers and will be much appreciated 馃槉

@justinwoo

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 26, 2019

as it should:

$ spago run --node-args "hello world"
Installation complete.
Build succeeded.
argv length:4
argv: ["/nix/store/trash-nodejs-10.16.0/bin/node","/home/justin/Code/spago-run-behavior/.spago/run.js","hello","world"]

$ .spago/run.js hello world
argv length:4
argv: ["/nix/store/trash-nodejs-10.16.0/bin/node","/home/justin/Code/spago-run-behavior/.spago/run.js","hello","world"]
nodeAction = do
echoDebug $ "Writing .spago/run.js"

This comment has been minimized.

Copy link
@f-f

f-f Jun 26, 2019

Member

This will affect also spago test. We might not want to write a script in that case, or write a script with a different name

This comment has been minimized.

Copy link
@justinwoo

justinwoo Jun 26, 2019

Author Collaborator

hyi herranjestas

@justinwoo justinwoo force-pushed the spago-run-behavior branch from 0746c8a to af01159 Jun 26, 2019

@justinwoo

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 27, 2019

this now works as expected 馃憤 e.g.

$ spago run -a ""
Installation complete.
Build succeeded.

You must provide an argument for an expression file to read and write to.

E.g. update-prefetch my-expression.nix

$ spago run -a "test/fetch-github.nix"
Installation complete.
Build succeeded.
updating GitHub fetch: justinwoo/psc-package2nix
updated test/fetch-github.nix.

@f-f f-f merged commit 127bac9 into master Jun 27, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@justinwoo justinwoo deleted the spago-run-behavior branch Jun 27, 2019

elliotdavies pushed a commit to elliotdavies/spago that referenced this pull request Jul 1, 2019

@f-f f-f referenced this pull request Jul 28, 2019

Merged

Add option to pass arguments to node on test/run (#267) #275

2 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.