diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2018-01-08 19:08:02 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2018-01-08 19:08:02 +0100 |
| commit | 3bedff357a38f965be91b9a88cbe0a82be4a1b4c (patch) | |
| tree | d3eea7d8ad1a046719d87fd79f2df5aed7fbb538 /modules/system | |
| parent | ac840a44b4a5a1d728938b7cb20e5b7a7d23e126 (diff) | |
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
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/etc.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/system/etc.nix b/modules/system/etc.nix index b99ca99..242570e 100644 --- a/modules/system/etc.nix +++ b/modules/system/etc.nix @@ -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 |
