From e6e33ce5ceb0d790fdaaa97253acc77e98954aa6 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 24 Jan 2026 04:54:51 +0800 Subject: Preserve original directory in make_lnk scripts --- scripts/make_lnk.ps1 | 3 +++ scripts/make_lnk.sh | 3 +++ 2 files changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/make_lnk.ps1 b/scripts/make_lnk.ps1 index 67d7ec2..2939cf3 100644 --- a/scripts/make_lnk.ps1 +++ b/scripts/make_lnk.ps1 @@ -1,4 +1,5 @@ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path +$originalLocation = Get-Location Set-Location $scriptDir $deployPs1 = Join-Path $scriptDir "dev\deploy.ps1" @@ -22,3 +23,5 @@ if (Test-Path $devDeployPs1) { $shortcut.TargetPath = $devDeployPs1 $shortcut.Save() } + +Set-Location $originalLocation diff --git a/scripts/make_lnk.sh b/scripts/make_lnk.sh index 3b52b97..81a7dd5 100644 --- a/scripts/make_lnk.sh +++ b/scripts/make_lnk.sh @@ -1,5 +1,6 @@ #!/bin/bash script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +original_dir="$(pwd)" cd "$(dirname "$0")" || exit 1 deploy_sh="$script_dir/dev/deploy.sh" dev_deploy_sh="$script_dir/dev/dev_deploy.sh" @@ -20,3 +21,5 @@ if [ -f "$dev_deploy_sh" ]; then fi ln -s "$dev_deploy_sh" "$link_path" fi + +cd "$original_dir" || exit 1 -- cgit