Refactor the nvs installation
This commit is contained in:
parent
6e67b188c2
commit
7283846d26
1 changed files with 12 additions and 6 deletions
|
@ -2,13 +2,19 @@
|
|||
NVS_HOME="${NVS_HOME:-'$HOME/.nvs'}";
|
||||
NVS_PATH="${NVS_PATH}";
|
||||
|
||||
profilePath="/etc/profile.d/nvs-home.sh";
|
||||
bashProfile="/etc/bash.bashrc";
|
||||
|
||||
{
|
||||
echo "export NVS_HOME=\"$NVS_HOME\"";
|
||||
echo "source \"$NVS_PATH/nvs.sh\"";
|
||||
} | sudo tee "$profilePath" > /dev/null;
|
||||
for profile in "$bashProfile" "/etc/fish/conf.d/nvs.fish" "/etc/zsh/zprofile"
|
||||
do
|
||||
if ! grep "\bNVS_HOME\b" "$profile"
|
||||
then
|
||||
{
|
||||
echo "export NVS_HOME=\"$NVS_HOME\"";
|
||||
echo 'source "'"$NVS_PATH"'/nvs.sh"';
|
||||
} | sudo tee "$profile";
|
||||
fi;
|
||||
done;
|
||||
|
||||
source "$profilePath";
|
||||
source "$bashProfile";
|
||||
nvs add latest;
|
||||
nvs link latest;
|
||||
|
|
Loading…
Reference in a new issue