Skip to content

Commit

Permalink
Don't bother making elvish-$version available.
Browse files Browse the repository at this point in the history
The binary name from old archives has an extra "v" before the $version, and it's
a hassle to handle. Just make Elvish available as "elvish".
  • Loading branch information
xiaq committed Feb 26, 2024
1 parent 6c0540e commit 30ee8fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
12 changes: 4 additions & 8 deletions main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,17 @@ 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 {
await run('sh', '-c',
`
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
`);
}
Expand Down

0 comments on commit 30ee8fe

Please sign in to comment.