diff --git a/packages/scripts/scripts/env/cli.js b/packages/scripts/scripts/env/cli.js index 05d083daae3e16..342947b35782b1 100644 --- a/packages/scripts/scripts/env/cli.js +++ b/packages/scripts/scripts/env/cli.js @@ -15,4 +15,4 @@ const args = getArgsFromCLI(); const localDir = env.LOCAL_DIR || 'src'; // Run PHPUnit with the working directory set correctly. -execSync( `npm run env:cli -- --path=${ localDir } ` + args.join( ' ' ), { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); +execSync( `npm run env:cli -- --path=/var/www/${ localDir } ` + args.join( ' ' ), { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); diff --git a/packages/scripts/scripts/env/install.js b/packages/scripts/scripts/env/install.js index 9e3b337db86783..106fb068491b4e 100644 --- a/packages/scripts/scripts/env/install.js +++ b/packages/scripts/scripts/env/install.js @@ -50,10 +50,14 @@ if ( commandExistsSync( 'git' ) ) { function buildWordPress() { execSync( 'npm install', { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); execSync( 'npm run env:start', { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); - execSync( 'npm run build:dev', { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); + if ( env.LOCAL_DIR === 'build' ) { + execSync( 'npm run build', { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); + } else { + execSync( 'npm run build:dev', { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); + } execSync( 'npm run env:install', { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); // Mount Gutenberg into the WordPress install. execSync( 'npm run env connect', { stdio: 'inherit' } ); - execSync( `npm run env:cli plugin activate ${ env.npm_package_wp_env_plugin_dir }`, { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } ); + execSync( `npm run env cli plugin activate ${ env.npm_package_wp_env_plugin_dir }`, { stdio: 'inherit' } ); }