Skip to content

Commit

Permalink
Add --force to options
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahum committed Dec 7, 2023
1 parent 2c6e0c9 commit edc0bad
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/bin/vip-deploy-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ const examples = [
usage: 'vip deploy app @mysite.develop file.zip --message "This is a commit message"',
description: 'Deploy the given ZIP file to your site',
},
{
usage: 'vip deploy app @mysite.develop file.zip --force',
description: 'Deploy the given compressed file to your site without prompting',
},
];

const promptToContinue = async ( { launched, formattedEnvironment, track, domain } ) => {
Expand Down Expand Up @@ -170,6 +174,7 @@ void command( {
} )
.examples( examples )
.option( 'message', 'Custom message for deploy' )
.option( 'force', 'Skip prompt' )
.argv( process.argv, async ( arg, opts ) => {
const { app, env } = opts;
const { id: envId, appId } = env;
Expand All @@ -194,14 +199,16 @@ void command( {
const formattedEnvironment = formatEnvironment( opts.env.type );
const launched = opts.env.launched;
const deployMessage = opts.message ?? '';

// PROMPT TO PROCEED WITH THE DEPLOY
await promptToContinue( {
launched,
formattedEnvironment,
track,
domain,
} );
const forceDeploy = opts.force;

if ( ! forceDeploy ) {
await promptToContinue( {
launched,
formattedEnvironment,
track,
domain,
} );
}

/**
* =========== WARNING =============
Expand Down

0 comments on commit edc0bad

Please sign in to comment.