From 2960729aa0eeed88ac834319069c149bb92818c9 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 26 Mar 2024 14:26:42 -0700 Subject: [PATCH] fix: Webinstall on Linux/macOS --- webinstall/install.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/webinstall/install.sh b/webinstall/install.sh index 415002a1..fc01e11f 100644 --- a/webinstall/install.sh +++ b/webinstall/install.sh @@ -27,6 +27,12 @@ if ! command -v unzip >/dev/null; then exit 1 fi +if [ "$OS" = "Windows_NT" ]; then + ext="zip" +else + ext="tar.gz" +fi + if [ "$OS" = "Windows_NT" ]; then target="win-x64" else @@ -38,18 +44,22 @@ else esac fi -eask_uri="https://github.com/emacs-eask/binaries/raw/master/${target}.zip" +eask_uri="https://github.com/emacs-eask/binaries/raw/master/${target}.${ext}" eask_bin_dir=~/.local/bin -zip=$eask_bin_dir/eask.zip +dwd_file=$eask_bin_dir/eask.${ext} mkdir -p $eask_bin_dir -curl -fsSL $eask_uri -o $zip +curl -fsSL $eask_uri -o $dwd_file -unzip -d "$eask_bin_dir" -o "$zip" +if [ "$OS" = "Windows_NT" ]; then + unzip -d "$eask_bin_dir" -o "$dwd_file" +else + tar -xvzf "$dwd_file" -C "$eask_bin_dir" +fi -rm $zip +rm $dwd_file echo echo "✓ Eask is installed in ${eask_bin_dir}."