Skip to content

Commit

Permalink
Fix permission flags for yarpm-pnpm binary, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BendingBender committed Jan 10, 2021
1 parent f22f147 commit 118b2b8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## v1.1.1

- fix permission flags for `yarpm-pnpm` binary, add tests

## v1.1.0

- add `yarpm-pnpm` binary to prefer `pnpm` over `npm` when run outside of a script
Expand Down
Empty file modified bin/yarpm-pnpm.js
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"keywords": [
"npm",
"pnpm",
"yarn",
"npm-scripts",
"cross-platform",
Expand Down
4 changes: 3 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pushd test-project 1>/dev/null

npm init -y
npm link yarpm
jq '.scripts=(.scripts + { "echo": "echo $(ps -p \"$$\" -o ppid= | xargs ps -o command | tail -n -1)", "yarpm-echo": "yarpm run echo", "yarpm-yarn-echo": "yarpm-yarn run echo" })' package.json > package.$$.json && mv package.$$.json package.json
jq '.scripts=(.scripts + { "echo": "echo $(ps -p \"$$\" -o ppid= | xargs ps -o command | tail -n -1)", "yarpm-echo": "yarpm run echo", "yarpm-pnpm-echo": "yarpm-pnpm run echo", "yarpm-yarn-echo": "yarpm-yarn run echo" })' package.json > package.$$.json && mv package.$$.json package.json
unset npm_execpath

function run_test {
Expand All @@ -22,6 +22,8 @@ function run_test {
}

run_test npm yarpm-echo '^npm foo$'
run_test pnpm yarpm-echo '^.+/pnpm.js run echo foo foo$'
run_test npm yarpm-pnpm-echo '^.+/pnpm run echo foo foo$'
run_test yarn yarpm-echo '^.+/yarn.js run echo foo foo$'
run_test npm yarpm-yarn-echo '^.+/yarn.js run echo foo foo$'

Expand Down

0 comments on commit 118b2b8

Please sign in to comment.