From 03b2ed5fb0a7aa935a10ec2a0e974fd9f927918c Mon Sep 17 00:00:00 2001 From: Dmitriy Petrov Date: Sun, 9 Aug 2026 13:18:53 +0300 Subject: [PATCH] Preserve local macOS client state during installs --- scripts/install-macos-client.sh | 7 ++++++- src/shared/versions.ts | 2 +- test/install-script.test.js | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/install-macos-client.sh b/scripts/install-macos-client.sh index 40a4988..ed5ccac 100755 --- a/scripts/install-macos-client.sh +++ b/scripts/install-macos-client.sh @@ -260,7 +260,11 @@ copy_source() { [ -f "$source_dir/docker-compose.client.yml" ] || die "invalid Harbor source archive" log "installing files to $INSTALL_DIR" mkdir -p "$INSTALL_DIR" - cp -R "$source_dir/." "$INSTALL_DIR/" + rsync -a --delete \ + --exclude='.env' \ + --exclude='.runtime' \ + --exclude='.git' \ + "$source_dir/" "$INSTALL_DIR/" } download_source() { @@ -282,6 +286,7 @@ fi need docker need curl +need rsync need tar docker compose version >/dev/null 2>&1 || die "Docker Compose plugin is required" diff --git a/src/shared/versions.ts b/src/shared/versions.ts index a3de11a..1067ceb 100644 --- a/src/shared/versions.ts +++ b/src/shared/versions.ts @@ -1,5 +1,5 @@ export const HARBOR_VERSIONS = Object.freeze({ - macClient: '0.21.2', + macClient: '0.21.3', gatewayClient: '0.22.0', gatewayBackend: '0.22.3', }); diff --git a/test/install-script.test.js b/test/install-script.test.js index dfaae01..12c59f9 100644 --- a/test/install-script.test.js +++ b/test/install-script.test.js @@ -40,3 +40,12 @@ test('one-line installer extracts the archive and hands it to the macOS installe fs.rmSync(tmp, { recursive: true, force: true }); } }); + +test('macOS installer removes stale archive files without deleting local state', () => { + const installer = fs.readFileSync(path.join(root, 'scripts', 'install-macos-client.sh'), 'utf8'); + + assert.match(installer, /rsync -a --delete/); + assert.match(installer, /--exclude='\.env'/); + assert.match(installer, /--exclude='\.runtime'/); + assert.match(installer, /--exclude='\.git'/); +});