File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,19 @@ command=(nix-instantiate --show-trace --expr '
21
21
inherit (builtins) currentSystem;
22
22
}' )
23
23
24
+ if readlink --version | grep GNU; then
25
+ readlink=" readlink -f"
26
+ else
27
+ if command -v greadlink & > /dev/null; then
28
+ readlink=" greadlink -f"
29
+ else
30
+ echo " Warning: symlinks not supported because readlink is non GNU" >&2
31
+ readlink=" realpath"
32
+ fi
33
+ fi
34
+
24
35
if [[ -f " $config " ]]; then
25
- config=$( readlink -f " $config " )
36
+ config=$( $ readlink " $config " )
26
37
command+=(--argstr configuration " $config " )
27
38
else
28
39
command+=(--arg configuration " $config " )
@@ -37,7 +48,7 @@ if [[ -n "$nix_path" && "$nix_path" != "-" ]]; then
37
48
fi
38
49
39
50
# Changing directory
40
- cd " $( readlink -f " $config_pwd " ) "
51
+ cd " $( $ readlink " $config_pwd " ) "
41
52
42
53
# Instantiate
43
54
echo " running (instantiating): ${NIX_PATH: +NIX_PATH=$NIX_PATH } ${command[*]@ Q} " -A out_path >&2
You can’t perform that action at this time.
0 commit comments