Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
Added a check to ensure assets actually exist before copying.
Browse files Browse the repository at this point in the history
  • Loading branch information
warrickbayman committed Sep 27, 2021
1 parent c70d2dc commit 04c4f11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.7.8] 27-09-2021
### Changed
* Attache will now first check that an asset exists before trying to copy to the target server.

## [0.7.7] 01-07-2021
### Changed
* Attache will no longer halt when a new SSH key has been added.
Expand Down
6 changes: 6 additions & 0 deletions src/Deployer.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,14 @@ protected function getAssetCommands(array $assets, string $releasePath): array
$commands = [];

foreach ($assets as $asset => $target) {
if (! file_exists($asset)) {
$commands[] = 'echo '.$asset . ' not found. Skipping.';
continue;
}

$target = Str::startsWith($target, '/') ? $target : '/'.$target;


$commands[] = 'scp -P'
.$this->server->port() // port
.' -r '.$asset.' ' // local asset
Expand Down

0 comments on commit 04c4f11

Please sign in to comment.