diff --git a/scripts/Common/Config/NVS/install.sh b/scripts/Common/Config/NVS/install.sh new file mode 100755 index 00000000..a67af0d6 --- /dev/null +++ b/scripts/Common/Config/NVS/install.sh @@ -0,0 +1,14 @@ +#!/bin/bash +NVS_HOME="${NVS_HOME:-'$HOME/.nvs'}"; +NVS_PATH="${NVS_PATH}"; + +profilePath="/etc/profile.d/nvs-home.sh"; + +{ + echo "NVS_HOME=\"$NVS_HOME\""; + echo "source \"$NVS_PATH/nvs.sh\""; +} | sudo tee "$profilePath" > /dev/null; + +source "$profilePath"; +nvs add latest; +nvs link latest; diff --git a/scripts/Common/Software/NVS/install.sh b/scripts/Common/Software/NVS/install.sh index 76b7bbe0..faa798fc 100755 --- a/scripts/Common/Software/NVS/install.sh +++ b/scripts/Common/Software/NVS/install.sh @@ -1,7 +1,11 @@ #!/bin/bash -export NVS_HOME="$HOME/.nvs"; +pushd "${BASH_SOURCE%/*}" > /dev/null; +home_expression='$HOME/.nvs'; +export NVS_HOME="$(bash -c echo $home_expression)"; git clone https://github.com/jasongin/nvs "$NVS_HOME"; -# shellcheck source=~/.nvs/nvs.sh -. "$NVS_HOME/nvs.sh" install; -bash -c 'exec bash -c "nvs add latest"'; -bash -c 'exec bash -c "nvs link latest"'; + +NVS_HOME="$home_expression" \ +NVS_PATH="$NVS_HOME" \ + . "../../Config/NVS/install.sh"; + +popd > /dev/null;