[pkg] [s]: validate package manager before run script
This commit is contained in:
@@ -55,15 +55,25 @@ async function promptPath() {
|
|||||||
* Main method to start CLI and validate inputs
|
* Main method to start CLI and validate inputs
|
||||||
*/
|
*/
|
||||||
async function run() {
|
async function run() {
|
||||||
|
|
||||||
|
if(checkPackageVersion(program.useNpm? 'npm' : 'yarn')) {
|
||||||
|
console.log()
|
||||||
|
console.log(`${chalk.yellowBright('Your package manager version is outdated, please update before continue.')}`)
|
||||||
|
console.log()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof projectPath === 'string') {
|
if (typeof projectPath === 'string') {
|
||||||
projectPath = projectPath.trim()
|
projectPath = projectPath.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!projectPath) {
|
if (!projectPath) {
|
||||||
const response = await promptPath()
|
const response = await promptPath()
|
||||||
if (typeof response.path === 'string') {
|
if (typeof response.path === 'string') {
|
||||||
projectPath = response.path.trim()
|
projectPath = response.path.trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!projectPath) {
|
if (!projectPath) {
|
||||||
//TODO separate log methods
|
//TODO separate log methods
|
||||||
console.log()
|
console.log()
|
||||||
|
|||||||
Reference in New Issue
Block a user