mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-25 14:08:07 +00:00
Add specific toolchain for Rust and Electrs build
This commit is contained in:
parent
ad77c3b528
commit
dbc601dcc7
|
@ -21,7 +21,23 @@ APP="$1"
|
|||
# Custom re-install steps
|
||||
if [ "$APP" = "rust" ] || [ "$APP" = "cargo" ]; then
|
||||
wget https://sh.rustup.rs -O /tmp/setup_rust.sh
|
||||
/bin/bash /tmp/setup_rust.sh -y
|
||||
/bin/bash /tmp/setup_rust.sh -y --default-toolchain none
|
||||
sync
|
||||
if [ -f $HOME/.cargo/env ]; then
|
||||
# Remove old toolchains
|
||||
source $HOME/.cargo/env
|
||||
TOOLCHAINS=$(rustup toolchain list)
|
||||
for toolchain in $TOOLCHAINS; do
|
||||
if [[ "$toolchain" == *"linux"* ]] && [[ "$toolchain" != *"${RUST_VERSION}"* ]]; then
|
||||
rustup toolchain remove $toolchain || true
|
||||
fi
|
||||
done
|
||||
|
||||
# Install and use desired version
|
||||
rustup install $RUST_VERSION
|
||||
rustup default $RUST_VERSION
|
||||
rustc --version
|
||||
fi
|
||||
elif [ "$APP" = "electrs" ]; then
|
||||
mkdir -p /home/admin/download
|
||||
cd /home/admin/download
|
||||
|
@ -37,7 +53,7 @@ elif [ "$APP" = "electrs" ]; then
|
|||
mv electrs-* electrs
|
||||
|
||||
cd electrs
|
||||
cargo build --release
|
||||
cargo +$RUST_VERSION build --release
|
||||
sudo install -g root -o root target/release/electrs /usr/bin/electrs
|
||||
cd ~
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user