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_HOME="${NVS_HOME:-'$HOME/.nvs'}";
|
||||||
NVS_PATH="${NVS_PATH}";
|
NVS_PATH="${NVS_PATH}";
|
||||||
|
|
||||||
profilePath="/etc/profile.d/nvs-home.sh";
|
bashProfile="/etc/bash.bashrc";
|
||||||
|
|
||||||
{
|
for profile in "$bashProfile" "/etc/fish/conf.d/nvs.fish" "/etc/zsh/zprofile"
|
||||||
echo "export NVS_HOME=\"$NVS_HOME\"";
|
do
|
||||||
echo "source \"$NVS_PATH/nvs.sh\"";
|
if ! grep "\bNVS_HOME\b" "$profile"
|
||||||
} | sudo tee "$profilePath" > /dev/null;
|
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 add latest;
|
||||||
nvs link latest;
|
nvs link latest;
|
||||||
|
|
Loading…
Reference in a new issue