File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 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 '
2121 inherit (builtins) currentSystem;
2222 }' )
2323
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+
2435if [[ -f " $config " ]]; then
25- config=$( readlink -f " $config " )
36+ config=$( $ readlink " $config " )
2637 command+=(--argstr configuration " $config " )
2738else
2839 command+=(--arg configuration " $config " )
@@ -37,7 +48,7 @@ if [[ -n "$nix_path" && "$nix_path" != "-" ]]; then
3748fi
3849
3950# Changing directory
40- cd " $( readlink -f " $config_pwd " ) "
51+ cd " $( $ readlink " $config_pwd " ) "
4152
4253# Instantiate
4354echo " 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