mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
uninstaller: reset any shells pointing to /run/current-system/sw/bin
This commit is contained in:
parent
1b5fa6be40
commit
9cd45289c9
1 changed files with 10 additions and 0 deletions
|
@ -46,5 +46,15 @@ with lib;
|
|||
echo >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# grep will return 1 when no lines matched which makes this line fail with `set -eo pipefail`
|
||||
dscl . -list /Users UserShell | { grep "\s/run/" || true; } | awk '{print $1}' | while read -r user; do
|
||||
shell=$(dscl . -read /Users/"$user" UserShell)
|
||||
if [[ "$shell" != */bin/zsh ]]; then
|
||||
echo >&2 "warning: changing $user's shell from $shell to /bin/zsh"
|
||||
fi
|
||||
|
||||
dscl . -create /Users/"$user" UserShell /bin/zsh
|
||||
done
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue