Skip to content

Commit

Permalink
Skip prompt to authenticate if CUSTOM_DEPLOY_KEY set and using vip ap…
Browse files Browse the repository at this point in the history
…p deploy
  • Loading branch information
rebeccahum committed Mar 6, 2024
1 parent 5983afd commit ddd911a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bin/vip.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if ( config && config.environment !== 'production' ) {

// Config
const tokenURL = 'https://dashboard.wpvip.com/me/cli/token';
const customDeployToken = process.env.CUSTOM_DEPLOY_KEY;

const runCmd = async function () {
const cmd = command();
Expand Down Expand Up @@ -63,6 +64,8 @@ const rootCmd = async function () {
const isDevEnvCommandWithoutEnv =
doesArgvHaveAtLeastOneParam( process.argv, [ 'dev-env' ] ) &&
! containsAppEnvArgument( process.argv );
const isCustomDeployCmdWithKey =
doesArgvHaveAtLeastOneParam( process.argv, [ 'deploy' ] ) && !! customDeployToken;

Check failure on line 68 in src/bin/vip.js

View workflow job for this annotation

GitHub Actions / Lint

use `Boolean(customDeployToken)` instead

debug( 'Argv:', process.argv );

Expand All @@ -72,7 +75,8 @@ const rootCmd = async function () {
isHelpCommand ||
isVersionCommand ||
isDevEnvCommandWithoutEnv ||
token?.valid() )
token?.valid() ||
isCustomDeployCmdWithKey )
) {
await runCmd();
} else {
Expand Down

0 comments on commit ddd911a

Please sign in to comment.