diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff7269d..22ddba1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,4 +21,3 @@ jobs: run: | echo This is Elvish $version elvish -c 'echo Can be used as an external command too' - elvish-${{ matrix.elvish-version }} -c 'echo Also available with explicit version' diff --git a/main.mjs b/main.mjs index 9961572..91f9f6c 100644 --- a/main.mjs +++ b/main.mjs @@ -21,10 +21,8 @@ async function main() { Invoke-RestMethod -Uri '${urlBase}.zip' -OutFile elvish.zip Expand-Archive elvish.zip -DestinationPath . rm elvish.zip - if (Test-Path elvish.exe -PathType leaf) { - New-Item -ItemType SymbolicLink -Path elvish-${version}.exe -Target elvish.exe - } else { - New-Item -ItemType SymbolicLink -Path elvish.exe -Target elvish-${version}.exe + if (!Test-Path elvish.exe -PathType leaf) { + Rename-Item -Path elvish-${version}.exe -NewName elvish.exe } `); } else { @@ -32,10 +30,8 @@ async function main() { ` cd /usr/local/bin curl -o- ${urlBase}.tar.gz | tar xz - if test -f elvish; then - ln -sf elvish elvish-${version} - else - ln -sf elvish-${version} elvish + if ! test -f elvish; then + mv elvish-${version} elvish fi `); }