mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-13 01:57:38 +08:00
chore: forward the exit code returned by the ssh command
also fix logging on error
This commit is contained in:
parent
ba940232a0
commit
7b80bf80a9
2 changed files with 9 additions and 4 deletions
|
@ -6,11 +6,16 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||
# Source the .env file from the parent directory of the script's directory
|
||||
source "$SCRIPT_DIR/../.env"
|
||||
|
||||
echo "Deploying backend to $BE_HOST with script $BE_SCRIPT_PATH"
|
||||
echo "Running $BE_SCRIPT_PATH on $BE_HOST with user $BE_USER"
|
||||
|
||||
# Connect to SSH and execute remote script
|
||||
ssh_output=$(ssh "$BE_USER@$BE_HOST" "$BE_SCRIPT_PATH")
|
||||
|
||||
# Capture the exit code of the SSH command
|
||||
exit_code=$?
|
||||
|
||||
# Print the output
|
||||
echo "Remote script output:"
|
||||
echo "$ssh_output"
|
||||
echo "$ssh_output"
|
||||
|
||||
# Forward the exit code of the remote script
|
||||
exit $exit_code
|
|
@ -30,7 +30,7 @@ const runCommand = (command, force) => {
|
|||
return output;
|
||||
} catch (error) {
|
||||
console.error(`Error executing command ${command}`);
|
||||
console.error(error);
|
||||
console.error(error.output.toString());
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue