Skip to content

Commit

Permalink
1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Stark committed Sep 24, 2021
1 parent 859d881 commit f486776
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.0.6 - 2021-09-24
- Exclude `resourcepaths` table from db backup
- Ignore mysql import errors 🤞🏻
- Better error output

## 1.0.5 - 2021-05-12
- Update craft-auto-migrate to use `project-config/apply`
Expand Down
4 changes: 4 additions & 0 deletions src/Exceptions/CraftNotInstalledException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@

class CraftNotInstalledException extends RemoteException
{
/**
* @var string
*/
public $message = 'Craft is not installed on the fortrabbit App.';
}
21 changes: 11 additions & 10 deletions src/Services/Ssh.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,25 @@ public function exec(string $cmd)
return true;
}

if (trim($process->getErrorOutput()) === 'Could not open input file') {
throw new CraftNotInstalledException(
trim($process->getErrorOutput())
);
}
$out = $process->getOutput();
$err = $process->getOutput();

if (stristr($process->getErrorOutput(), 'Unknown command')) {
throw new PluginNotInstalledException(
'The Craft Copy plugin is not installed on remote.'
);
if (stristr($out, 'Could not open input file')) {
throw new CraftNotInstalledException();
}
if (stristr($err, 'Could not open input file')) {
throw new CraftNotInstalledException();
}
if (stristr($err, 'Unknown command')) {
throw new PluginNotInstalledException();
}

throw new RemoteException(
implode(PHP_EOL, [
'SSH Remote error: ' . $process->getExitCode(),
'Command: ' . $process->getCommandLine(),
'Output:',
$process->getErrorOutput(),
$err,
])
);
}
Expand Down

0 comments on commit f486776

Please sign in to comment.