cc-safe-setup 1.0.3 → 1.0.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/index.mjs +13 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -49,6 +49,8 @@ function ask(question) {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
const DRY_RUN = process.argv.includes('--dry-run') || process.argv.includes('-n');
|
|
53
|
+
|
|
52
54
|
async function main() {
|
|
53
55
|
console.log();
|
|
54
56
|
console.log(c.bold + ' cc-safe-setup' + c.reset);
|
|
@@ -79,6 +81,17 @@ async function main() {
|
|
|
79
81
|
}
|
|
80
82
|
console.log();
|
|
81
83
|
|
|
84
|
+
if (DRY_RUN) {
|
|
85
|
+
console.log(c.yellow + ' --dry-run: showing what would be installed (no changes made)' + c.reset);
|
|
86
|
+
console.log();
|
|
87
|
+
for (const [id, hook] of Object.entries(HOOKS)) {
|
|
88
|
+
console.log(' ' + c.dim + 'would install: ' + join(HOOKS_DIR, id + '.sh') + c.reset);
|
|
89
|
+
}
|
|
90
|
+
console.log(' ' + c.dim + 'would update: ' + SETTINGS_PATH + c.reset);
|
|
91
|
+
console.log();
|
|
92
|
+
process.exit(0);
|
|
93
|
+
}
|
|
94
|
+
|
|
82
95
|
const answer = await ask(' Install all ' + Object.keys(HOOKS).length + ' safety hooks? [Y/n] ');
|
|
83
96
|
if (answer.toLowerCase() === 'n') {
|
|
84
97
|
console.log('\n ' + c.dim + 'Cancelled.' + c.reset + '\n');
|
package/package.json
CHANGED