Skip to content

Commit 99e3138

Browse files
committed
Add error message when target folder does not exist
1 parent 5627fb1 commit 99e3138

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Dist_Archive_Command.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ public function __invoke( $args, $assoc_args ) {
128128
$this->maybe_create_directory( $archive_file );
129129
}
130130

131+
if ( ! is_dir( dirname( $archive_file ) ) ) {
132+
WP_CLI::error( "Target directory does not exist: {$archive_file}" );
133+
}
134+
131135
if ( 'zip' === $assoc_args['format'] ) {
132136
$excludes = implode( ' --exclude ', $ignored_files );
133137
if ( ! empty( $excludes ) ) {

0 commit comments

Comments
 (0)