the-frame-ai 0.9.1 → 0.9.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/package.json +1 -1
- package/src/languages.js +9 -19
package/package.json
CHANGED
package/src/languages.js
CHANGED
|
@@ -52,28 +52,18 @@ export async function promptLanguage(langOverride, yes = false) {
|
|
|
52
52
|
const options = LANGUAGES.map((l, i) => ` ${i + 1}) ${l.label}`).join('\n');
|
|
53
53
|
const footer = `\n Enter number [1-${LANGUAGES.length}] (or press Enter for auto): `;
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const choice = answer.trim();
|
|
58
|
-
if (choice === '' || choice === '1') {
|
|
59
|
-
rl.close();
|
|
60
|
-
return resolve('auto');
|
|
61
|
-
}
|
|
55
|
+
const answer = (await ask(rl, prompt + options + footer)).trim();
|
|
56
|
+
rl.close();
|
|
62
57
|
|
|
63
|
-
|
|
64
|
-
if (idx >= 0 && idx < LANGUAGES.length) {
|
|
65
|
-
rl.close();
|
|
66
|
-
return resolve(LANGUAGES[idx].code);
|
|
67
|
-
}
|
|
58
|
+
if (answer === '' || answer === '1') return 'auto';
|
|
68
59
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
resolve(code.trim().toLowerCase() || 'auto');
|
|
72
|
-
});
|
|
73
|
-
});
|
|
60
|
+
const idx = parseInt(answer, 10) - 1;
|
|
61
|
+
if (idx >= 0 && idx < LANGUAGES.length) return LANGUAGES[idx].code;
|
|
74
62
|
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
const rl2 = createInterface({ input: process.stdin, output: process.stdout });
|
|
64
|
+
const custom = (await ask(rl2, ' Enter custom language code (e.g., "ja", "ko", "fr"): ')).trim().toLowerCase();
|
|
65
|
+
rl2.close();
|
|
66
|
+
return custom || 'auto';
|
|
77
67
|
}
|
|
78
68
|
|
|
79
69
|
const STACK_PRESETS = {
|