tokrepo 3.3.2 → 3.3.3
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/bin/tokrepo.js +11 -5
- package/package.json +1 -1
package/bin/tokrepo.js
CHANGED
|
@@ -24,7 +24,7 @@ const CONFIG_DIR = path.join(require('os').homedir(), '.tokrepo');
|
|
|
24
24
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
25
25
|
const PROJECT_CONFIG = '.tokrepo.json';
|
|
26
26
|
const DEFAULT_API = 'https://api.tokrepo.com';
|
|
27
|
-
const CLI_VERSION = '3.3.
|
|
27
|
+
const CLI_VERSION = '3.3.3';
|
|
28
28
|
const VERSION_CHECK_FILE = path.join(require('os').homedir(), '.tokrepo', '.version-check');
|
|
29
29
|
|
|
30
30
|
// ─── Helpers ───
|
|
@@ -1207,16 +1207,22 @@ async function cmdUpdate() {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
|
|
1209
1209
|
async function cmdDelete() {
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1210
|
+
const args = parseArgs(process.argv);
|
|
1211
|
+
const uuid = args.positional[0];
|
|
1212
|
+
if (!uuid) error('Usage: tokrepo delete <uuid> [--yes]');
|
|
1212
1213
|
|
|
1213
1214
|
log(`\n${C.bold}tokrepo delete${C.reset}\n`);
|
|
1214
1215
|
|
|
1215
1216
|
const config = readConfig();
|
|
1216
1217
|
if (!config || !config.token) error('Not logged in. Run: tokrepo login');
|
|
1217
1218
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1219
|
+
// --yes / -y / TOKREPO_NONINTERACTIVE 跳过交互式确认(脚本/CI 友好)。
|
|
1220
|
+
// 没有这两个的话仍然要 y/N 防误删。
|
|
1221
|
+
const skipConfirm = Boolean(args.flags.yes) || Boolean(args.flags.y) || process.env.TOKREPO_NONINTERACTIVE === '1';
|
|
1222
|
+
if (!skipConfirm) {
|
|
1223
|
+
const confirm = await ask(`Delete ${uuid.substring(0,8)}...? (y/N):`);
|
|
1224
|
+
if (confirm.toLowerCase() !== 'y') { log('Aborted.'); return; }
|
|
1225
|
+
}
|
|
1220
1226
|
|
|
1221
1227
|
try {
|
|
1222
1228
|
await apiRequest('DELETE', '/api/v1/tokenboard/workflows/delete', { uuid }, config.token, config.api);
|