From 56a98b9aaf4d9b01b95bf3b565382f2846b584d6 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Sun, 27 Aug 2023 14:53:23 +0100 Subject: [PATCH] fix proxy script, create and switch to lapce dir before download/unpack (#2571) --- extra/proxy.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/extra/proxy.sh b/extra/proxy.sh index 6d1d1767..babf0cfa 100644 --- a/extra/proxy.sh +++ b/extra/proxy.sh @@ -55,7 +55,8 @@ case $(uname -s) in Linux) os_name=linux ;; Darwin) os_name=darwin ;; *) - printf '[ERROR] unsupported os' + printf '[ERROR] unsupported os\n' + exit 1 ;; esac @@ -65,12 +66,17 @@ case $(uname -m) in arm64|aarch64) arch_name=aarch64 ;; # riscv64) arch_name=riscv64 ;; *) - printf '[ERROR] unsupported arch' + printf '[ERROR] unsupported arch\n' + exit 1 ;; esac 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 # How old curl has these options? we'll find out printf 'Downloading using curl\n' @@ -84,9 +90,6 @@ else exit 1 fi -printf 'Creating "%s"\n' "${lapce_dir}" -mkdir -p "${lapce_dir}" - printf 'Decompressing gzip\n' gzip -d "${lapce_dir}/lapce-proxy-${os_name}-${arch_name}.gz"