rangement/utils/workInProgress/setup.mjs

38 lines
917 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-09-10 11:30:50 +02:00
import config_rangement from '../../conf/configs.js'
2023-07-04 12:08:05 +02:00
2023-09-10 11:30:50 +02:00
const { stdin, stdout } = process
2023-07-04 12:08:05 +02:00
2023-09-10 11:30:50 +02:00
function prompt (question) {
return new Promise((resolve, reject) => {
stdin.resume()
stdout.write(question)
2023-07-04 12:08:05 +02:00
2023-09-10 11:30:50 +02:00
stdin.on('data', data => resolve(data.toString().trim()))
stdin.on('error', err => reject(err))
})
2023-07-04 12:08:05 +02:00
}
2023-09-10 11:30:50 +02:00
async function main () {
try {
// const name = await prompt(i18next.t("home.title"))
const name = await prompt(`squoi le dossier de base des archives? [${config_rangement.base_archive_folder}]`)
// const age = await prompt("What's your age? ");
// const email = await prompt("What's your email address? ");
// const user = { name, age, email };
console.log('le dossier de base des archives est : ', name)
stdin.pause()
} catch (error) {
console.log('There\'s an error!')
console.log(error)
}
process.exit()
2023-07-04 12:08:05 +02:00
}
2023-09-10 11:30:50 +02:00
main()
2023-07-04 12:08:05 +02:00