pressship 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@ class Pressship_WP_CLI_Command {
|
|
|
55
55
|
$npx = getenv( 'PRESSSHIP_NPX' ) ?: self::default_npx_binary();
|
|
56
56
|
$package = getenv( 'PRESSSHIP_NPX_PACKAGE' ) ?: self::default_npx_package();
|
|
57
57
|
$argv = array_merge(
|
|
58
|
-
array( $npx, '--yes', $package ),
|
|
58
|
+
array( $npx, '--yes', '--prefix', self::npx_prefix_dir(), '--package', $package, 'pressship' ),
|
|
59
59
|
array_values( $args ),
|
|
60
60
|
self::assoc_args_to_argv( $assoc_args )
|
|
61
61
|
);
|
|
@@ -146,6 +146,20 @@ class Pressship_WP_CLI_Command {
|
|
|
146
146
|
return 'pressship';
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Isolated npm prefix so npx does not resolve a same-named local workspace.
|
|
151
|
+
*
|
|
152
|
+
* @return string
|
|
153
|
+
*/
|
|
154
|
+
private static function npx_prefix_dir() {
|
|
155
|
+
$directory = rtrim( sys_get_temp_dir(), DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . 'pressship-wp-cli-npx';
|
|
156
|
+
if ( ! is_dir( $directory ) ) {
|
|
157
|
+
mkdir( $directory, 0700, true );
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return $directory;
|
|
161
|
+
}
|
|
162
|
+
|
|
149
163
|
/**
|
|
150
164
|
* Detect Windows without depending on WP-CLI utils.
|
|
151
165
|
*
|