From 0aad051f3ac30c084889b58f6002a08f08ec034c Mon Sep 17 00:00:00 2001 From: tytan652 <17492366+tytan652@users.noreply.github.com> Date: Thu, 22 Aug 2019 10:53:56 +0200 Subject: [PATCH] perf: make the scripts only install one toolchain install and upgrade scripts will install the last nightly toolchain, but bitwarden_rs have a rust-toochain file that causes another toolchain to be installed if they differ. Then the toolchain specified in the rust-toochain file is now installed as default toolchain --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index ca5b7f8..42ece2d 100644 --- a/scripts/install +++ b/scripts/install @@ -117,9 +117,9 @@ ynh_script_progression --message="Making install..." --weight=780 # Set right permissions chown -R "$app":"$app" $final_path -# Install rustup +# Install rustup with the toolchain needed by bitwarden_rs pushd $final_path - sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=nightly' + sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=$(cat build/rust-toolchain)' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" diff --git a/scripts/upgrade b/scripts/upgrade index 32c63af..f6d409f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -126,9 +126,9 @@ chown -R "$app":"$app" $final_path if [ "$upgrade_type" == "UPGRADE_APP" ] then - # Install rustup + # Install rustup with the toolchain needed by bitwarden_rs pushd $final_path - sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=nightly' + sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=$(cat build/rust-toolchain)' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"