@gkiely/safe-install 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -30,7 +30,7 @@ ignore-scripts=true
30
30
  ```json
31
31
  {
32
32
  "scripts": {
33
- "safe-install": "npx -y @gkiely/safe-install"
33
+ "safe-install": "npx -y @gkiely/safe-install -- --no-audit --no-fund"
34
34
  }
35
35
  }
36
36
  ```
@@ -59,7 +59,7 @@ specifiers.
59
59
  6. Use `safe-install` for future installs:
60
60
 
61
61
  ```sh
62
- npm run safe-install -- --no-audit --no-fund
62
+ npm run safe-install
63
63
  ```
64
64
 
65
65
  ## What `safe-install` does
package/dist/index.js CHANGED
@@ -154,23 +154,19 @@ export function installCommand(args = []) {
154
154
  }
155
155
  }
156
156
  export function main(args = process.argv.slice(2)) {
157
- const [command] = args;
157
+ if (args.includes("--help") || args.includes("-h")) {
158
+ printHelp();
159
+ return;
160
+ }
161
+ const command = args.find((arg) => arg !== "--" && !arg.startsWith("-"));
158
162
  if (command === undefined) {
159
- installCommand();
163
+ installCommand(args.filter((arg) => arg !== "--"));
160
164
  return;
161
165
  }
162
166
  if (command === "review-deps") {
163
167
  reviewDepsCommand();
164
168
  return;
165
169
  }
166
- if (command === "--help" || command === "-h") {
167
- printHelp();
168
- return;
169
- }
170
- if (command.startsWith("-")) {
171
- installCommand(args);
172
- return;
173
- }
174
170
  throw new Error(`Unknown command: ${command}`);
175
171
  }
176
172
  if (process.argv[1] && realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1])) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gkiely/safe-install",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Run npm installs with lifecycle scripts disabled, then rebuild explicitly trusted dependencies.",
5
5
  "author": "Grant Kiely <grant@youneedawiki.com>",
6
6
  "license": "MIT",