rangement/setup.mjs

39 lines
1018 B
JavaScript
Raw Normal View History

2023-07-04 12:08:05 +02:00
/**
création de la config
*/
2023-07-04 15:26:27 +02:00
// import i18next from 'i18next'
2023-07-19 10:04:08 +02:00
import config_rangement from "./conf/configs.js";
2023-07-04 12:08:05 +02:00
const { stdin, stdout } = process;
function prompt(question) {
return new Promise((resolve, reject) => {
stdin.resume();
stdout.write(question);
stdin.on('data', data => resolve(data.toString().trim()));
stdin.on('error', err => reject(err));
});
}
async function main() {
try {
2023-07-04 15:26:27 +02:00
// const name = await prompt(i18next.t("home.title"))
const name = await prompt(`squoi le dossier de base des archives? [${config_rangement.base_archive_folder}]`)
2023-07-04 12:08:05 +02:00
// const age = await prompt("What's your age? ");
// const email = await prompt("What's your email address? ");
// const user = { name, age, email };
2023-07-19 10:04:08 +02:00
console.log('le dossier de base des archives est : ',name);
2023-07-04 12:08:05 +02:00
stdin.pause();
} catch(error) {
console.log("There's an error!");
console.log(error);
}
process.exit();
}
main();