forked from kaisalmen/wsltooling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallRust.sh
More file actions
20 lines (14 loc) · 696 Bytes
/
Copy pathinstallRust.sh
File metadata and controls
20 lines (14 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
set -euo pipefail
DIR_ME=$(realpath $(dirname $0))
# This script is called by any user. It shall succeed without a username parameter
. ${DIR_ME}/.installUtils.sh
setUserName ${1-"$(whoami)"}
# Modifications of bashrc is done only by modifyBashrc function, therefore files changed by installer are saved and restored
cp ${HOMEDIR}/.bashrc ${HOMEDIR}/.bashrc.bak
cp ${HOMEDIR}/.profile ${HOMEDIR}/.profile.bak
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o ${HOMEDIR}/Downloads/rustup
bash ${HOMEDIR}/Downloads/rustup -y
mv ${HOMEDIR}/.bashrc.bak ${HOMEDIR}/.bashrc
mv ${HOMEDIR}/.profile.bak ${HOMEDIR}/.profile
modifyBashrc ".cargo/env" ". ${HOMEDIR}/.cargo/env"