这是indexloc提供的服务,不要输入任何密码
Skip to content

Set cmd.Dir to an absolute path when we execute scripts #1774

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

Merged
merged 3 commits into from
Aug 30, 2022

Conversation

gsoltis
Copy link
Contributor

@gsoltis gsoltis commented Aug 25, 2022

Setting cmd.Dir to an absolute path ensures that it will continue to work in the presence of the --cwd flag.

Bonus drop unused turboCache from execContext.

Note that this PR stacks on top of #1773

@vercel
Copy link

vercel bot commented Aug 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
turbo-site ✅ Ready (Inspect) Visit Preview Aug 30, 2022 at 8:26PM (UTC)

@gsoltis gsoltis force-pushed the gsoltis/abs_path_read_json branch from db96142 to c2cac53 Compare August 25, 2022 22:20
@gsoltis gsoltis force-pushed the gsoltis/exec_abs_path branch from 6ad41e7 to adf42d8 Compare August 25, 2022 22:20
Base automatically changed from gsoltis/abs_path_read_json to main August 26, 2022 17:13
@gsoltis gsoltis force-pushed the gsoltis/exec_abs_path branch from adf42d8 to f88cf5e Compare August 26, 2022 17:17
@gsoltis gsoltis marked this pull request as ready for review August 26, 2022 17:17
@gsoltis gsoltis requested a review from a team as a code owner August 26, 2022 17:17
Copy link
Contributor

@mehulkar mehulkar left a comment

Choose a reason for hiding this comment

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

had a question, but otherwise looks good to me

runCache: runCache,
logger: r.config.Logger,
packageManager: packageManager,
processes: r.processes,
taskHashes: hashes,
repoRoot: r.config.Cwd,
Copy link
Contributor

Choose a reason for hiding this comment

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

Saw some chatter about cwd when turbo is run from a directory other than root of monorepo. Is r.config.Cwd here always "root of monorepo" or can it be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we resolve Config.Cwd to either the program's working directory, or the value of the --cwd flag. In the upcoming cobra port, this gets renamed to RepoRoot to hopefully be more clear.

@gsoltis gsoltis added the pr: automerge Kodiak will merge these automatically after checks pass label Aug 30, 2022
@kodiakhq kodiakhq bot merged commit 0ca1ff2 into main Aug 30, 2022
@kodiakhq kodiakhq bot deleted the gsoltis/exec_abs_path branch August 30, 2022 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants