@struggler/cli 1.0.14 → 1.0.15

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/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@struggler/cli",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "CLI to Upload vite packaged files to Qiniu Cloud OSS.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "add-version": "node ./command/addVersion.js",
8
- "test": "node --test"
8
+ "test": "node --test",
9
+ "postinstall": "node ./scripts/postinstall.js"
9
10
  },
10
11
  "bin": {
11
12
  "struggler-cli": "./index.js"
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ // Only print the hint during global installs; skip in CI / local dev installs.
3
+ const isGlobal = process.env.npm_config_global === 'true';
4
+ const isCI = process.env.CI || process.env.CONTINUOUS_INTEGRATION;
5
+
6
+ if (!isGlobal || isCI) process.exit(0);
7
+
8
+ const shell = (process.env.SHELL || '').split('/').pop();
9
+ const supported = shell === 'zsh' || shell === 'bash';
10
+
11
+ console.log('');
12
+ console.log(' \u2728 struggler-cli installed!');
13
+ if (supported) {
14
+ console.log(' \u2192 Enable tab completion (one-time setup):');
15
+ console.log(' struggler-cli completion install');
16
+ } else {
17
+ console.log(' \u2192 Enable tab completion: struggler-cli completion <zsh|bash|install>');
18
+ }
19
+ console.log('');