Fix yq syntax in deployment script for Debian yq version

This commit is contained in:
openhands 2025-10-30 12:49:04 +00:00
parent 0076e263f9
commit dacb06fdc8
1 changed files with 10 additions and 10 deletions

View File

@ -111,20 +111,20 @@ load_configuration() {
# Check if yq is available for YAML parsing # Check if yq is available for YAML parsing
if ! command -v yq &> /dev/null; then if ! command -v yq &> /dev/null; then
print_error "yq is required for YAML parsing. Install with: snap install yq or brew install yq" print_error "yq is required for YAML parsing. Install with: apt-get install yq"
exit 1 exit 1
fi fi
# Extract configuration values # Extract configuration values (yq with jq syntax)
SSH_HOST=$(yq e '.ssh.host' "$CONFIG_FILE") SSH_HOST=$(yq -r '.ssh.host' "$CONFIG_FILE")
SSH_PORT=$(yq e '.ssh.port' "$CONFIG_FILE") SSH_PORT=$(yq -r '.ssh.port' "$CONFIG_FILE")
SSH_USERNAME=$(yq e '.ssh.username' "$CONFIG_FILE") SSH_USERNAME=$(yq -r '.ssh.username' "$CONFIG_FILE")
SSH_KEY_FILE=$(yq e '.ssh.key_file' "$CONFIG_FILE") SSH_KEY_FILE=$(yq -r '.ssh.key_file' "$CONFIG_FILE")
TARGET_DIR=$(yq e '.deployment.target_dir' "$CONFIG_FILE") TARGET_DIR=$(yq -r '.deployment.target_dir' "$CONFIG_FILE")
BACKUP_DIR=$(yq e '.deployment.backup_dir' "$CONFIG_FILE") BACKUP_DIR=$(yq -r '.deployment.backup_dir' "$CONFIG_FILE")
LOG_DIR=$(yq e '.deployment.log_dir' "$CONFIG_FILE") LOG_DIR=$(yq -r '.deployment.log_dir' "$CONFIG_FILE")
CONFIG_DIR=$(yq e '.deployment.config_dir' "$CONFIG_FILE") CONFIG_DIR=$(yq -r '.deployment.config_dir' "$CONFIG_FILE")
# Validate required configuration # Validate required configuration
if [[ -z "$SSH_HOST" || -z "$SSH_USERNAME" || -z "$SSH_KEY_FILE" ]]; then if [[ -z "$SSH_HOST" || -z "$SSH_USERNAME" || -z "$SSH_KEY_FILE" ]]; then