Skip to content

Commit

Permalink
Add Rustc feature (#1905)
Browse files Browse the repository at this point in the history
* feat: rustc feature

* feat: make already installed message consistent

* fix: curl params

* fix: feature name
  • Loading branch information
ALameLlama authored Nov 1, 2023
1 parent 6c9656a commit aecfdb1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/features/rustc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

if [ -f ~/.homestead-features/wsl_user_name ]; then
WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)"
WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)"
else
WSL_USER_NAME=vagrant
WSL_USER_GROUP=vagrant
fi

export DEBIAN_FRONTEND=noninteractive

if [ -f /home/$WSL_USER_NAME/.homestead-features/rustc ]; then
echo "Rust already installed."
exit 0
fi

touch /home/$WSL_USER_NAME/.homestead-features/rustc
chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features

# Run the Rust installation script as the user
sudo -u $WSL_USER_NAME curl -LsS https://sh.rustup.rs | sudo -u $WSL_USER_NAME sh -s -- -y

0 comments on commit aecfdb1

Please sign in to comment.