ensure the /dist/ folder exists before writing feature-config-core
- change the default target environment to development
This commit is contained in:
parent
b134853e83
commit
9ec06baeb3
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
$phase = isset( $_SERVER['WC_ADMIN_PHASE'] ) ? $_SERVER['WC_ADMIN_PHASE'] : ''; // WPCS: sanitization ok.
|
$phase = isset( $_SERVER['WC_ADMIN_PHASE'] ) ? $_SERVER['WC_ADMIN_PHASE'] : ''; // WPCS: sanitization ok.
|
||||||
if ( ! in_array( $phase, array( 'development', 'plugin', 'core' ), true ) ) {
|
if ( ! in_array( $phase, array( 'development', 'plugin', 'core' ), true ) ) {
|
||||||
$phase = 'core';
|
$phase = 'development';
|
||||||
}
|
}
|
||||||
$config_json = file_get_contents( 'config/' . $phase . '.json' );
|
$config_json = file_get_contents( 'config/' . $phase . '.json' );
|
||||||
$config = json_decode( $config_json );
|
$config = json_decode( $config_json );
|
||||||
|
@ -35,6 +35,10 @@ if ( 'core' !== $phase ) {
|
||||||
}
|
}
|
||||||
$write .= "\t\t\t)";
|
$write .= "\t\t\t)";
|
||||||
|
|
||||||
|
if ( is_file( './dist' ) || ! wp_mkdir_p( './dist' ) ) {
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
$config_file = fopen( 'dist/feature-config-core.php', 'w' );
|
$config_file = fopen( 'dist/feature-config-core.php', 'w' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue