From 47fc045d68b479d559f1b94ff005a0e48c773789 Mon Sep 17 00:00:00 2001 From: Thadeu Cotts Date: Tue, 1 Dec 2020 10:08:28 -0300 Subject: [PATCH] [pkg] [s]: validate package manager before run script --- packages/create-portal-app/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/create-portal-app/index.js b/packages/create-portal-app/index.js index 44cc281d..236362b8 100755 --- a/packages/create-portal-app/index.js +++ b/packages/create-portal-app/index.js @@ -55,15 +55,25 @@ async function promptPath() { * Main method to start CLI and validate inputs */ 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') { projectPath = projectPath.trim() } + if (!projectPath) { const response = await promptPath() if (typeof response.path === 'string') { projectPath = response.path.trim() } } + if (!projectPath) { //TODO separate log methods console.log()