diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 0967f80..060282f 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -33,7 +33,9 @@ export const deploy = async ( args: IDeployParams, hre: HardhatRuntimeEnvironment, ) => { - await checkCodeVersion(); + if (!await checkCodeVersion()) { + return; + } // Compile again in case we have a coverage build (binary too large to deploy) await hre.run('compile'); diff --git a/scripts/utils/helper.ts b/scripts/utils/helper.ts index eb89afb..d2d8ed4 100644 --- a/scripts/utils/helper.ts +++ b/scripts/utils/helper.ts @@ -13,9 +13,10 @@ export const checkCodeVersion = async () => { if (localLatestCommit !== remoteLatestCommit) { console.log("🟡 Warning: you are NOT using the latest version of the code. Please run `git pull` on main branch to update the code."); if (!(await confirm({ message: 'Proceed anyway?', default: false }))) { - process.exit(0); + return false; }; } + return true; } export const estimateGas = async (hre: HardhatRuntimeEnvironment, tx: Deferrable) => {