mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
etc: make link warnings more noticable
Hopefully this helps to make it more obvious that the file will not be created by nix-darwin. See #65
This commit is contained in:
parent
ac840a44b4
commit
3bedff357a
1 changed files with 4 additions and 3 deletions
|
@ -45,14 +45,14 @@ in
|
|||
ln -sfn "$(readlink -f $systemConfig/etc)" /etc/static
|
||||
|
||||
for f in $(find /etc/static/* -type l); do
|
||||
l="$(echo $f | sed 's,/etc/static/,/etc/,')"
|
||||
d="$(dirname $l)"
|
||||
l=/etc/''${f#/etc/static/}
|
||||
d=''${l%/*}
|
||||
if [ ! -e "$d" ]; then
|
||||
mkdir -p "$d"
|
||||
fi
|
||||
if [ -e "$l" ]; then
|
||||
if [ "$(readlink $l)" != "$f" ]; then
|
||||
echo "warning: not linking $l because $l exists, skipping..." >&2
|
||||
echo "[1;31mwarning: not linking environment.etc.\"''${l#/etc/}\" because $l exists, skipping...[0m" >&2
|
||||
fi
|
||||
else
|
||||
ln -s "$f" "$l"
|
||||
|
@ -61,6 +61,7 @@ in
|
|||
|
||||
for l in $(find /etc/* -type l 2> /dev/null); do
|
||||
f="$(echo $l | sed 's,/etc/,/etc/static/,')"
|
||||
f=/etc/static/''${l#/etc/}
|
||||
if [ "$(readlink $l)" = "$f" -a ! -e "$(readlink -f $l)" ]; then
|
||||
rm "$l"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue