use $PSScriptRoot (other)

This commit is contained in:
qwjyh 2023-03-16 22:28:28 +09:00
parent 043ea58fbd
commit c1a708a088
2 changed files with 4 additions and 13 deletions

View file

@ -2,14 +2,8 @@
# Be sure to install AutoHotKey first # Be sure to install AutoHotKey first
# check working directory # change working directory to git root
if (!( Set-Location (Join-Path $PSScriptRoot "..")
(Test-Path bin) -and (Test-Path dotfiles)
)) {
Write-Warning -Message "wrong current path
please execute at repo root"
exit 1
}
# set Ahk2Exe.exe path # set Ahk2Exe.exe path
# example "C:\Program Files\AutoHotKey\Compiler\Ahk2Exe.exe" # example "C:\Program Files\AutoHotKey\Compiler\Ahk2Exe.exe"

View file

@ -6,11 +6,8 @@ if(!(Get-Command scoop -ErrorAction SilentlyContinue)) {
exit 1 exit 1
} }
# execution location # change working directory to git root
if(!((Test-Path bin) -and (Test-Path dotfiles))) { Set-Location (Join-Path $PSScriptRoot "..")
Write-Warning "This script need to be executed in dotfiles root"
exit 2
}
# export to JSON # export to JSON