fuzzrunx 0.1.1 → 0.1.2
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 +1 -0
- package/package.json +1 -1
- package/scripts/postinstall.js +4 -1
- package/src/cli.js +16 -0
- package/src/installer.js +3 -0
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ On global install, FuzzRun auto-enables shell hooks and will print:
|
|
|
18
18
|
`FuzzRun is automatically enabled. Run "fuzzrun disable" to deactivate.`
|
|
19
19
|
|
|
20
20
|
If you want to skip auto-enable, set `FUZZRUN_SKIP_ENABLE=1` during install.
|
|
21
|
+
If auto-enable didn't run (scripts disabled or local install), running any command with `fuzzrun` will attempt a one-time auto-enable unless `FUZZRUN_SKIP_ENABLE=1` is set.
|
|
21
22
|
|
|
22
23
|
### Bash/Zsh hook (auto-run on typos)
|
|
23
24
|
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
const installer = require('../src/installer');
|
|
4
4
|
|
|
5
5
|
const skip = process.env.FUZZRUN_SKIP_ENABLE === '1';
|
|
6
|
-
const isGlobal =
|
|
6
|
+
const isGlobal =
|
|
7
|
+
process.env.npm_config_global === 'true' ||
|
|
8
|
+
process.env.npm_config_global === '1' ||
|
|
9
|
+
process.env.npm_config_location === 'global';
|
|
7
10
|
|
|
8
11
|
if (skip || !isGlobal) {
|
|
9
12
|
process.stdout.write('fuzzrun: auto-enable skipped\n');
|
package/src/cli.js
CHANGED
|
@@ -469,6 +469,22 @@ function main() {
|
|
|
469
469
|
process.exit(0);
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
+
if (process.env.FUZZRUN_SKIP_ENABLE !== '1') {
|
|
473
|
+
try {
|
|
474
|
+
const status = installer.status();
|
|
475
|
+
const anyEnabled = status.some((item) => item.enabled);
|
|
476
|
+
if (!anyEnabled) {
|
|
477
|
+
const results = installer.enable({});
|
|
478
|
+
const updated = results.some((item) => item.updated);
|
|
479
|
+
if (updated) {
|
|
480
|
+
process.stdout.write('FuzzRun auto-enabled. Restart your shell to apply changes.\n');
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
} catch (err) {
|
|
484
|
+
process.stderr.write(`fuzzrun: auto-enable failed: ${err.message}\n`);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
472
488
|
const baseCommand = argv[0];
|
|
473
489
|
const rest = argv.slice(1);
|
|
474
490
|
const firstRun = run(baseCommand, rest);
|
package/src/installer.js
CHANGED
|
@@ -102,6 +102,9 @@ function removeProfileSnippet(filePath) {
|
|
|
102
102
|
|
|
103
103
|
function pickTargets() {
|
|
104
104
|
const targets = getProfileTargets();
|
|
105
|
+
if (process.platform === 'win32') {
|
|
106
|
+
return targets;
|
|
107
|
+
}
|
|
105
108
|
const existing = targets.filter((target) => fs.existsSync(target));
|
|
106
109
|
if (existing.length) return existing;
|
|
107
110
|
return [targets[0]];
|