Skip to content

Commit 96b1d66

Browse files
committed
fix(install): avoid self-linking installed binary
1 parent 5163826 commit 96b1d66

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

vix-site/public/install.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,18 @@ function Install-Cli([string]$archivePath, [string]$tmpDir) {
217217
Select-Object -First 1
218218

219219
if (-not $exeCandidate) {
220-
Die "archive does not contain $BinName"
220+
Die "SDK archive does not contain $BinName"
221221
}
222222

223223
$exe = Join-Path $BinDir $BinName
224224

225-
Copy-Item -LiteralPath $exeCandidate.FullName -Destination $exe -Force
225+
if (-not [string]::Equals(
226+
$exeCandidate.FullName,
227+
$exe,
228+
[System.StringComparison]::OrdinalIgnoreCase
229+
)) {
230+
Copy-Item -LiteralPath $exeCandidate.FullName -Destination $exe -Force
231+
}
226232

227233
return $exe
228234
}

vix-site/public/install.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,12 @@ install_sdk() {
267267
[ -n "$target" ] || die "could not find installed '$BIN_NAME'"
268268

269269
chmod +x "$target"
270-
ln -sf "$target" "$VIX_INSTALL_BIN_DIR/$BIN_NAME"
271270

272271
DEST="$VIX_INSTALL_BIN_DIR/$BIN_NAME"
272+
273+
if [ "$target" != "$DEST" ]; then
274+
ln -sf "$target" "$DEST"
275+
fi
273276
}
274277

275278
detect_platform

0 commit comments

Comments
 (0)