Skip to content

Commit

Permalink
💩 Fix @go-task/go-npm package so that @go-task/cli package can be…
Browse files Browse the repository at this point in the history
… used on Windows
  • Loading branch information
sounisi5011 committed Apr 2, 2023
1 parent 713e9a1 commit abb45e1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
},
"pnpm": {
"patchedDependencies": {
"is-promise@4.0.0": "patches/is-promise@4.0.0.patch"
"is-promise@4.0.0": "patches/is-promise@4.0.0.patch",
"@go-task/go-npm@0.1.17": "patches/@go-task__go-npm@0.1.17.patch"
}
}
}
11 changes: 11 additions & 0 deletions patches/@go-task__go-npm@0.1.17.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/bin/index.js b/bin/index.js
--- a/bin/index.js
+++ b/bin/index.js
@@ -1,1 +1,7 @@
#!/usr/bin/env node
+const path = require('path');
+const PATH = Object.entries(process.env).concat([['path', '']]).find(([key]) => /^PATH$/i.test(key))[1];
+if (
+ process.env.npm_config_prefix
+ && !PATH.split(path.delimiter).some(pathdir => path.resolve(pathdir) === path.resolve(process.env.npm_config_prefix, 'bin'))
+) delete process.env.npm_config_prefix;
8 changes: 6 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit abb45e1

Please sign in to comment.