fix proxy script, create and switch to lapce dir before download/unpack (#2571)

This commit is contained in:
Jakub Panek 2023-08-27 14:53:23 +01:00 committed by GitHub
parent ea36dbcae7
commit 56a98b9aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -55,7 +55,8 @@ case $(uname -s) in
Linux) os_name=linux ;; Linux) os_name=linux ;;
Darwin) os_name=darwin ;; Darwin) os_name=darwin ;;
*) *)
printf '[ERROR] unsupported os' printf '[ERROR] unsupported os\n'
exit 1
;; ;;
esac esac
@ -65,12 +66,17 @@ case $(uname -m) in
arm64|aarch64) arch_name=aarch64 ;; arm64|aarch64) arch_name=aarch64 ;;
# riscv64) arch_name=riscv64 ;; # riscv64) arch_name=riscv64 ;;
*) *)
printf '[ERROR] unsupported arch' printf '[ERROR] unsupported arch\n'
exit 1
;; ;;
esac esac
lapce_download_url="https://github.com/lapce/lapce/releases/download/${lapce_new_ver_tag}/lapce-proxy-${os_name}-${arch_name}.gz" lapce_download_url="https://github.com/lapce/lapce/releases/download/${lapce_new_ver_tag}/lapce-proxy-${os_name}-${arch_name}.gz"
printf 'Creating "%s"\n' "${lapce_dir}"
mkdir -p "${lapce_dir}"
cd "${lapce_dir}"
if test_cmd 'curl'; then if test_cmd 'curl'; then
# How old curl has these options? we'll find out # How old curl has these options? we'll find out
printf 'Downloading using curl\n' printf 'Downloading using curl\n'
@ -84,9 +90,6 @@ else
exit 1 exit 1
fi fi
printf 'Creating "%s"\n' "${lapce_dir}"
mkdir -p "${lapce_dir}"
printf 'Decompressing gzip\n' printf 'Decompressing gzip\n'
gzip -d "${lapce_dir}/lapce-proxy-${os_name}-${arch_name}.gz" gzip -d "${lapce_dir}/lapce-proxy-${os_name}-${arch_name}.gz"