-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,37 @@ | ||
#!/bin/sh | ||
|
||
# first install rust | ||
echo "Installing Rust first..." | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
|
||
# next install SciDataFlow | ||
if ! command -v rustc &> /dev/null; then | ||
|
||
# expected MD5 of Rust | ||
expected_md5="9457a47bb675d495b53d2ebbb757f63d" | ||
|
||
# temp installer file | ||
temp_file=$(mktemp) | ||
|
||
# download Rust installer | ||
curl --proto '=https' --tlsv1.2 -sSf -o "$temp_file" https://sh.rustup.rs | ||
|
||
# calculate the MD5 hash of the downloaded file | ||
calculated_md5=$(md5sum "$temp_file" | awk '{ print $1 }') | ||
|
||
# verify MD5 hash | ||
if [ "$expected_md5" != "$calculated_md5" ]; then | ||
echo "MD5 verification of Rust installer failed! This is likely a version change.\nPlease report, and install manually from:\nhttps://www.rust-lang.org/learn/get-started" | ||
rm "$temp_file" | ||
exit 1 | ||
else | ||
echo "MD5 verified. Installing Rust..." | ||
sh "$temp_file" | ||
fi | ||
|
||
# remove the temporary file | ||
rm "$temp_file" | ||
else | ||
echo "Rust is already installed." | ||
fi | ||
|
||
# install SciDataFlow | ||
echo "Now installing SciDataFlow..." | ||
cargo install scidataflow | ||
|