Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check if user passes absolute path to prune (#4891)
### Description As discovered in #4885, we forcibly join `--out-dir` to the repo root even if it's absolute. This PR adds a check that skips the join if the user passes an absolute system path. ### Testing Instructions Added failing integration test
- Loading branch information
1 parent
3e1c136
commit fd3ac51
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Setup | ||
$ . ${TESTDIR}/../../../helpers/setup.sh | ||
$ . ${TESTDIR}/../_helpers/setup_monorepo.sh $(pwd) monorepo_with_root_dep | ||
|
||
Test that absolute paths can be passed as out-dir | ||
$ TMPFILE=$(mktemp) | ||
$ ${TURBO} prune --scope=web --out-dir=${TMPFILE} | ||
Generating pruned monorepo for web in .* (re) | ||
- Added shared | ||
- Added util | ||
- Added web | ||
$ cat ${TMPFILE}/package.json | ||
{ | ||
"devDependencies": { | ||
"util": "workspace:*" | ||
}, | ||
"name": "monorepo", | ||
"packageManager": "pnpm@7.25.1", | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"is-number@7.0.0": "patches/is-number@7.0.0.patch" | ||
} | ||
} | ||
} |