rangement/utils/workInProgress/setup.mjs

38 lines
917 B
JavaScript

/**
création de la config
*/
// import i18next from 'i18next'
import config_rangement from '../../conf/configs.js'
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 {
// 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()
}
main()