You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use Utils\make_temp_file() and Utils\make_temp_dir() for temporary paths #249
wp-cli/wp-cli#6374 added Utils\make_temp_file() and Utils\make_temp_dir() (merged to main, milestone 3.0.0). src/Package_Command.php still builds temporary paths by hand:
line 279: Utils\get_temp_dir() . uniqid( 'wp-cli-package_', true ) . '.zip' for the downloaded ZIP
line 294: Utils\get_temp_dir() . uniqid( 'wp-cli-package_', true ) for the extraction directory
Switch them to Utils\make_temp_file( 'wp-cli-package_', '.zip' ) and Utils\make_temp_dir( 'wp-cli-package_' ). Two things to check on the way: make_temp_dir() creates the directory (mode 0700) before Extractor::extract() runs, so the extractor gets an existing empty directory instead of creating it, and it returns the path with a trailing slash, which the later get_package_name_and_version_from_dir_package(), copy_overwrite_files() and rmdir() calls receive.
Blocked on a wp-cli/wp-cli release that ships the helpers. composer.json already requires wp-cli/wp-cli ^3.0.
Activity