mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-12-22 15:03:28 +00:00
If Nix profile environment exist, source it before installation check
This commit is contained in:
parent
3e0e991ad2
commit
c5729e9110
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
profileEnv=$HOME/.nix-profile/etc/profile.d/nix.sh
|
||||
|
||||
# if Nix profile already exists, source the environment. This is mostly useful for self-hosted runners, see issue #98
|
||||
if [[ -f $profileEnv ]]; then
|
||||
source $profileEnv
|
||||
fi
|
||||
|
||||
if type -p nix &>/dev/null ; then
|
||||
echo "Aborting: Nix is already installed at $(type -p nix)"
|
||||
exit
|
||||
|
|
Loading…
Reference in a new issue