[feat] [s]: main method to run CLI

This commit is contained in:
Thadeu Cotts 2020-11-23 17:07:44 -03:00
parent d5e925546d
commit 870fd15264

View File

@ -38,4 +38,39 @@ program.name(package.name)
}
})
}
/**
* Main method to start CLI and validate inputs
*/
async function run(){
if(typeof path === 'string'){
path = path.trim()
}
if(!path){
const response = await promptPath()
if(typeof response.path === 'string'){
path = response.path.trim()
}
}
if(!path){
console.log()
console.log('Please choose a name to your project:')
console.log()
console.log('Example:')
console.log(`${chalk.cyan(program.name())} ${chalk.yellow('ny-portal-app')}`)
console.log()
process.exit(1)
}
/**
* TODO Include workflow to create and manage the files and options
*
* Example:
* createApp()
* .then(installDependencies)
* .then(renameFiles)
* .then(checkUpdated)
*/
}