@bobfrankston/npmglobalize 1.0.49 → 1.0.50
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/lib.js +24 -10
- package/package.json +1 -1
package/lib.js
CHANGED
|
@@ -1254,31 +1254,45 @@ export async function globalize(cwd, options = {}, configOptions = {}) {
|
|
|
1254
1254
|
if (!cleanup && !asis) {
|
|
1255
1255
|
const checkResult = checkIgnoreFiles(cwd, { conform, asis, verbose });
|
|
1256
1256
|
if (checkResult.needsUpdate) {
|
|
1257
|
-
console.log(colors.yellow('\
|
|
1257
|
+
console.log(colors.yellow('\nRecommended additions to ignore files:'));
|
|
1258
|
+
// Group changes by file for more compact display
|
|
1259
|
+
const gitignoreChanges = [];
|
|
1260
|
+
const npmignoreChanges = [];
|
|
1258
1261
|
for (const change of checkResult.changes) {
|
|
1259
|
-
|
|
1262
|
+
if (change.includes('.gitignore')) {
|
|
1263
|
+
gitignoreChanges.push(change.replace(' .gitignore missing: ', '').trim());
|
|
1264
|
+
}
|
|
1265
|
+
else if (change.includes('.npmignore')) {
|
|
1266
|
+
npmignoreChanges.push(change.replace(' .npmignore missing: ', '').trim());
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
if (gitignoreChanges.length > 0) {
|
|
1270
|
+
console.log(colors.yellow(' .gitignore: ') + gitignoreChanges.join(', '));
|
|
1271
|
+
}
|
|
1272
|
+
if (npmignoreChanges.length > 0) {
|
|
1273
|
+
console.log(colors.yellow(' .npmignore: ') + npmignoreChanges.join(', '));
|
|
1260
1274
|
}
|
|
1261
1275
|
console.log('');
|
|
1262
1276
|
if (conform) {
|
|
1263
|
-
console.log('
|
|
1277
|
+
console.log('Applying changes (--conform)...');
|
|
1264
1278
|
conformIgnoreFiles(cwd);
|
|
1265
1279
|
console.log('');
|
|
1266
1280
|
}
|
|
1267
1281
|
else {
|
|
1268
|
-
console.log('
|
|
1269
|
-
console.log(' ' + colors.green('
|
|
1270
|
-
console.log(' ' + colors.yellow('asis') + '
|
|
1271
|
-
console.log(' ' + colors.red('abort') + '
|
|
1282
|
+
console.log('Options:');
|
|
1283
|
+
console.log(' ' + colors.green('ok') + ' - Apply these changes now');
|
|
1284
|
+
console.log(' ' + colors.yellow('asis') + ' - Skip and continue as-is');
|
|
1285
|
+
console.log(' ' + colors.red('abort') + ' - Stop and exit');
|
|
1272
1286
|
console.log('');
|
|
1273
|
-
const choice = await promptChoice('Your choice [
|
|
1274
|
-
if (choice === '
|
|
1287
|
+
const choice = await promptChoice('Your choice [ok/asis/abort]:', ['ok', 'asis', 'abort']);
|
|
1288
|
+
if (choice === 'ok') {
|
|
1275
1289
|
console.log('Applying changes...');
|
|
1276
1290
|
conformIgnoreFiles(cwd);
|
|
1277
1291
|
console.log(colors.green('✓ Ignore files updated'));
|
|
1278
1292
|
console.log('');
|
|
1279
1293
|
}
|
|
1280
1294
|
else if (choice === 'asis') {
|
|
1281
|
-
console.log(colors.yellow('Continuing
|
|
1295
|
+
console.log(colors.yellow('Continuing as-is...'));
|
|
1282
1296
|
console.log('');
|
|
1283
1297
|
}
|
|
1284
1298
|
else {
|