ensure the /dist/ folder exists before writing feature-config-core

- change the default target environment to development
This commit is contained in:
Ron Rennick 2019-04-15 09:25:14 -03:00
parent b134853e83
commit 9ec06baeb3
1 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,7 @@
$phase = isset( $_SERVER['WC_ADMIN_PHASE'] ) ? $_SERVER['WC_ADMIN_PHASE'] : ''; // WPCS: sanitization ok.
if ( ! in_array( $phase, array( 'development', 'plugin', 'core' ), true ) ) {
$phase = 'core';
$phase = 'development';
}
$config_json = file_get_contents( 'config/' . $phase . '.json' );
$config = json_decode( $config_json );
@ -35,6 +35,10 @@ if ( 'core' !== $phase ) {
}
$write .= "\t\t\t)";
if ( is_file( './dist' ) || ! wp_mkdir_p( './dist' ) ) {
exit( 1 );
}
$config_file = fopen( 'dist/feature-config-core.php', 'w' );
}