Skip to content

Commit

Permalink
Quick fix: Only remove old env if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc45 committed Mar 14, 2024
1 parent 871eb81 commit 091c0b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Binary file modified qit
Binary file not shown.
6 changes: 4 additions & 2 deletions src/src/Environment/EnvironmentDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ public function maybe_download( string $env_name ): void {
}

// Delete old environment extracted files.
$safe_remove = App::make( SafeRemove::class );
$safe_remove->delete_dir( $environments_dir . '/' . $env_name, Config::get_qit_dir() );
if ( file_exists( $environments_dir . '/' . $env_name ) ) {
$safe_remove = App::make( SafeRemove::class );
$safe_remove->delete_dir( $environments_dir . '/' . $env_name, Config::get_qit_dir() );
}

if ( ! $zip->extractTo( $environments_dir . '/' . $env_name ) ) {
throw new \RuntimeException( 'Could not extract environment zip.' );
Expand Down

0 comments on commit 091c0b0

Please sign in to comment.