rangement/setup.mjs

38 lines
968 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'
import config_rangement from "./configs";
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 };
console.log(name);
stdin.pause();
} catch(error) {
console.log("There's an error!");
console.log(error);
}
process.exit();
}
main();