smoonb 0.0.78 → 0.0.79
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/interactive/envMapper.js +24 -23
package/package.json
CHANGED
|
@@ -206,33 +206,34 @@ async function mapEnvVariablesInteractively(env, expectedKeys) {
|
|
|
206
206
|
throw new Error(`Duplicidade de mapeamento detectada para ${clientKey}`);
|
|
207
207
|
}
|
|
208
208
|
dePara[clientKey] = expected;
|
|
209
|
+
}
|
|
209
210
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
211
|
+
// Após processar todas as variáveis, perguntar sobre idioma padrão se SMOONB_OUTPUT_DIR foi processado
|
|
212
|
+
const outputDirProcessed = Object.values(dePara).includes('SMOONB_OUTPUT_DIR');
|
|
213
|
+
if (outputDirProcessed) {
|
|
214
|
+
const currentLang = finalEnv.SMOONB_LANG || '';
|
|
215
|
+
const { normalizeLocale } = require('../i18n');
|
|
216
|
+
|
|
217
|
+
const langChoices = [
|
|
218
|
+
{ name: getT('env.language.english'), value: 'en' },
|
|
219
|
+
{ name: getT('env.language.portuguese'), value: 'pt-BR' }
|
|
220
|
+
];
|
|
219
221
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
const defaultLang = currentLang ? normalizeLocale(currentLang) || 'en' : 'en';
|
|
223
|
+
const defaultIndex = langChoices.findIndex(c => c.value === defaultLang);
|
|
222
224
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
225
|
+
const { selectedLang } = await inquirer.prompt([{
|
|
226
|
+
type: 'list',
|
|
227
|
+
name: 'selectedLang',
|
|
228
|
+
message: getT('env.language.selectDefault'),
|
|
229
|
+
choices: langChoices,
|
|
230
|
+
default: defaultIndex >= 0 ? defaultIndex : 0,
|
|
231
|
+
loop: false,
|
|
232
|
+
prefix: ''
|
|
233
|
+
}]);
|
|
232
234
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
235
|
+
finalEnv.SMOONB_LANG = selectedLang;
|
|
236
|
+
console.log(chalk.green(`✅ ${getT('env.language.saved', { lang: selectedLang })}`));
|
|
236
237
|
}
|
|
237
238
|
|
|
238
239
|
return { finalEnv, dePara };
|