skip-local-postinstall
Advanced tools
Comparing version
#!/usr/bin/env node | ||
import { execSync } from 'child_process' | ||
import { skip } from './index.js' | ||
skip(1) | ||
skip() | ||
const command = ['node', ...process.argv.slice(2, process.argv.length)].join( | ||
' ' | ||
) | ||
execSync(command, { stdio: 'inherit' }) |
@@ -5,2 +5,9 @@ # Changelog | ||
### [2.0.1](https://github.com/tobua/skip-local-postinstall/compare/v2.0.0...v2.0.1) (2021-03-16) | ||
### Bug Fixes | ||
* **bin:** bin script with successful exit code and documentation ([a2b8d15](https://github.com/tobua/skip-local-postinstall/commit/a2b8d15a6185afaea6e75d5b6119aa0de8a86540)) | ||
## [2.0.0](https://github.com/tobua/skip-local-postinstall/compare/v1.0.5...v2.0.0) (2021-03-16) | ||
@@ -7,0 +14,0 @@ |
{ | ||
"name": "skip-local-postinstall", | ||
"description": "Skips postinstall when installed locally.", | ||
"version": "2.0.0", | ||
"description": "Skip postinstall on local npm installs.", | ||
"version": "2.0.1", | ||
"repository": "github:tobua/skip-local-postinstall", | ||
"scripts": { | ||
"build": "padua build", | ||
"start": "padua watch", | ||
"hello": "skip-local-postinstall && echo 'test'" | ||
"start": "padua watch" | ||
}, | ||
@@ -11,0 +10,0 @@ "padua": { |
@@ -5,8 +5,6 @@ # skip-local-postinstall | ||
```json | ||
```js | ||
// package.json | ||
{ | ||
"scripts": { | ||
"postinstall": "node ./installation.js" | ||
} | ||
"scripts": { | ||
"postinstall": "node ./installation.js" | ||
} | ||
@@ -27,6 +25,11 @@ ``` | ||
Bin script testing | ||
## Compiled Postinstall File | ||
// cd node_modules/.bin (copy a link and rename) | ||
ln -hfs /Users/tobua/skip-local-postinstall/bin.js skip-local-postinstall | ||
chmod 755 ./bin.js | ||
In cases where you want a compiled postinstall script (i.e. source in TypeScript) this plugin also includes a bin script. It's arguments will be passed directly to the `node` command and can include additional arguments apart from the file to run. | ||
```js | ||
// package.json | ||
"scripts": { | ||
"postinstall": "skip-local-postinstall ./dist/installation.js" | ||
} | ||
``` |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
4641
15.25%17
41.67%34
9.68%1
Infinity%