icoa-cli 2.19.68 → 2.19.69
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/dist/repl.js +17 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/repl.js
CHANGED
|
@@ -101,6 +101,23 @@ export async function startRepl(program, resumeMode) {
|
|
|
101
101
|
const connected = isConnected();
|
|
102
102
|
const realExit = process.exit.bind(process);
|
|
103
103
|
const activated = isActivated();
|
|
104
|
+
// Auto-cleanup: clear demo state once per version upgrade.
|
|
105
|
+
// Demo is free practice with no time pressure, no scoring, no real loss
|
|
106
|
+
// for users. Old versions may have left demo state in incompatible formats
|
|
107
|
+
// (pre-v2.19.45 shared state, pre-v2.19.67 timestamp confusion, etc.).
|
|
108
|
+
// Real exam state is NEVER auto-cleared — it may contain in-progress answers.
|
|
109
|
+
if (config.demoCleanedForVersion !== VERSION) {
|
|
110
|
+
try {
|
|
111
|
+
const { existsSync, unlinkSync } = await import('node:fs');
|
|
112
|
+
const { join } = await import('node:path');
|
|
113
|
+
const { getIcoaDir } = await import('./lib/config.js');
|
|
114
|
+
const demoFile = join(getIcoaDir(), 'demo-state.json');
|
|
115
|
+
if (existsSync(demoFile))
|
|
116
|
+
unlinkSync(demoFile);
|
|
117
|
+
}
|
|
118
|
+
catch { }
|
|
119
|
+
saveConfig({ demoCleanedForVersion: VERSION });
|
|
120
|
+
}
|
|
104
121
|
// ─── Mode selection (every launch) ───
|
|
105
122
|
const { select: selectMode, confirm: confirmMode } = await import('@inquirer/prompts');
|
|
106
123
|
const savedMode = config.mode || '';
|
package/dist/types/index.d.ts
CHANGED