Added Rust crates script

Necessary to implement the installation of Rust and associated crates
which can be used by downstream configurations. This functionality was
originally part of the macOS Configuration project but has been moved
here to provide a common foundation in which to build upon.
This commit is contained in:
Brooke Kuhlmann
2021-03-14 10:35:58 -06:00
parent eec175e232
commit 35663cf8b3
5 changed files with 49 additions and 1 deletions

View File

@@ -126,3 +126,20 @@ verify_path() {
fi
}
export -f verify_path
# Checks for missing Rust crates.
verify_rust_crates() {
printf "\nChecking Rust crates...\n"
local crates="$(ls -A1 $HOME/.cargo/bin)"
while read line; do
if [[ "$line" == "cargo install"* ]]; then
local crate=$(printf "$line" | awk '{print $3}')
verify_listed_application "$crate" "${crates[*]}"
fi
done < "$MAC_OS_CONFIG_PATH/bin/install_rust_crates"
printf "Rust crates check complete.\n"
}
export -f verify_rust_crates