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

feat(run): Set INIT_CWD in environment #5656

Merged
merged 2 commits into from
Apr 13, 2018
Merged

feat(run): Set INIT_CWD in environment #5656

merged 2 commits into from
Apr 13, 2018

Conversation

DimitarNestorov
Copy link
Contributor

@DimitarNestorov DimitarNestorov commented Apr 12, 2018

Summary
INIT_CWD environment variable holds the full path you were in when you ran yarn run

Motivation: https://twitter.com/housecor/status/983773854530260992

Test plan

  1. Create a script called testscript.js
  2. In the file type console.log(process.env.INIT_CWD);
  3. In package.json add a script with a key testscript and value node testscript.js
  4. Build yarn
  5. Call ../bin/yarn testscript from the command line in a subfolder
  6. The script should log the folder you're running the script from

Video: https://www.youtube.com/watch?v=XY_w8GVtuCY

Test plan

Added a new test.

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great and concise patch, thanks a lot!

@BYK BYK changed the title yarn run: added INIT_CWD in the environment feat(run): Set INIT_CWD in environment Apr 13, 2018
@BYK BYK merged commit 3a04db7 into yarnpkg:master Apr 13, 2018
@DimitarNestorov
Copy link
Contributor Author

DimitarNestorov commented Apr 13, 2018

Thank you @BYK!

Just wanted to ask did ci/circleci: test-linux-node4 fail because of outside forces or RNG? If yes is there a way to rerun it in case I believe it did fail randomly?

I can't imagine writing a test fixes another test 😄

image
image

@BYK
Copy link
Member

BYK commented Apr 13, 2018

@DimitarNestorov I don't see the failure :S

@DimitarNestorov
Copy link
Contributor Author

@BYK It's on the first commit of the pull request.
image

@BYK
Copy link
Member

BYK commented Apr 15, 2018

@DimitarNestorov don't worry about that one, probably was a fluke :)

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

Successfully merging this pull request may close these issues.

2 participants