Skip to content

Commit 801a854

Browse files
committed
fix: strip quoted config migration target
1 parent 3f18f52 commit 801a854

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

.facts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@
212212
- label: config migrations do not require the JSR package through routines/utils.ts
213213
command: ! rg -q 'jsr:@std/fmt' routines/utils.ts && target=$(grep '^HARBOR_CONFIG_VERSION=' profiles/default.env | cut -d= -f2- | tr -d '"'); tmp_dir=$(mktemp -d); DENO_DIR="$tmp_dir" deno run --cached-only -A --unstable-sloppy-imports .scripts/migrate.ts --target "$target" --dry-run; status=$?; rm -rf "$tmp_dir"; exit $status
214214
tags: [spec, fmt-migration, implemented]
215+
- label: harbor migrate auto-detects the quoted HARBOR_CONFIG_VERSION from profiles/default.env and passes an unquoted semver target to the config migrator
216+
command: tmp_lock=$(mktemp); cp .scripts/deno.lock "$tmp_lock"; restore_lock() { cp "$tmp_lock" .scripts/deno.lock; rm -f "$tmp_lock"; }; trap restore_lock EXIT; ./harbor.sh migrate --dry-run
217+
tags: [spec, config-migration-version, implemented]
215218

216219
## bash-compat
217220
- label: harbor.sh avoids Bash 4 case-conversion parameter expansion so the CLI parses on macOS Bash 3

harbor.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4246,6 +4246,7 @@ run_migrate_command() {
42464246
*)
42474247
log_debug "Running migration script"
42484248
local target_config_version=$(grep '^HARBOR_CONFIG_VERSION=' "$default_profile" | cut -d '=' -f2-)
4249+
target_config_version="${target_config_version#\"}"
42494250
target_config_version="${target_config_version%\"}"
42504251

42514252
if [[ -z "$target_config_version" ]]; then

0 commit comments

Comments
 (0)