diff --git a/packages/cli/src/commands/deployment/deploy.ts b/packages/cli/src/commands/deployment/deploy.ts index 4b71357db5..57af92837e 100644 --- a/packages/cli/src/commands/deployment/deploy.ts +++ b/packages/cli/src/commands/deployment/deploy.ts @@ -17,7 +17,7 @@ import { projectsInfo, redeploy, } from '../../controller/deploy-controller'; -import {checkToken, promptWithDefaultValues, valueOrPrompt} from '../../utils'; +import {addV, checkToken, promptWithDefaultValues, valueOrPrompt} from '../../utils'; const ACCESS_TOKEN_PATH = path.resolve(process.env.HOME, '.subql/SUBQL_ACCESS_TOKEN'); export default class Deploy extends Command { @@ -64,6 +64,8 @@ export default class Deploy extends Command { ipfsCID = await valueOrPrompt(ipfsCID, 'Enter IPFS CID', 'IPFS CID is required'); const validator = await ipfsCID_validate(ipfsCID, authToken, ROOT_API_URL_PROD); + queryVersion = addV(queryVersion); + indexerVersion = addV(indexerVersion); if (!validator.valid) { throw new Error(chalk.bgRedBright('Invalid IPFS CID')); diff --git a/packages/cli/src/utils.ts b/packages/cli/src/utils.ts index ffe5f5d305..15729dbbb5 100644 --- a/packages/cli/src/utils.ts +++ b/packages/cli/src/utils.ts @@ -21,6 +21,13 @@ export async function valueOrPrompt(value: T, msg: string, error: string): Pr } } +export function addV(str: string | undefined) { + if (str && !str.includes('v')) { + return `v${str}`; + } + return str; +} + export async function promptWithDefaultValues( promptType: Inquirer | typeof ux, msg: string,