Skip to content

Commit

Permalink
feat(cli): add --skip-upgrade-record flag (#1526)
Browse files Browse the repository at this point in the history
Co-authored-by: saeta.eth <saetaeth@proton.me>
  • Loading branch information
mjlescano and saeta-eth authored Nov 5, 2024
1 parent 2b94e24 commit 369b909
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface Params {
overrideResolver?: CannonRegistry;
wipe?: boolean;
persist?: boolean;
skipUpgradeRecord?: false;
plugins?: boolean;
privateSourceCode?: boolean;
rpcUrl?: string;
Expand All @@ -71,6 +72,7 @@ export async function build({
overrideResolver,
wipe = false,
persist = true,
skipUpgradeRecord = false,
plugins = true,
privateSourceCode = false,
rpcUrl,
Expand Down Expand Up @@ -446,7 +448,7 @@ export async function build({
const metaUrl = await runtime.putBlob(metadata);

// write upgrade-from info on-chain
if (stepsExecuted && persist) {
if (stepsExecuted && persist && !skipUpgradeRecord) {
for (let i = 0; i < 3; i++) {
try {
log(gray('Writing upgrade info...'));
Expand Down
7 changes: 6 additions & 1 deletion packages/cli/src/commands/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ export const commandsConfig: CommandsConfig = {
},
{
flags: '--upgrade-from [cannon-package:0.0.1]',
description: 'Specify a package to use as a new base for the deployment.',
description: 'Specify a package to use as a new base for the deployment',
},
{
flags: '--skip-upgrade-record',
description:
'Skip step taken at the end of the build to save the execution record on-chain, which would be used for future reference on upgrades',
},
{
flags: '--registry-priority <registry>',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ applyCommandsConfig(program.command('build'), commandsConfig.build)
}

if (options.keepAlive && node) {
log(`The local node will continue running at ${node.host}`);
log(`The local node will continue running at ${node!.host}`);

const { run } = await import('./commands/run');

Expand Down

0 comments on commit 369b909

Please sign in to comment.