mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Patch for detect shell file in Solus OS
This commit is contained in:
parent
c3b072eace
commit
48dad2561f
1 changed files with 12 additions and 3 deletions
|
|
@ -23,8 +23,13 @@ main() {
|
|||
# Only enable exit-on-error after the non-critical colorization stuff,
|
||||
# which may fail on systems lacking tput or terminfo
|
||||
set -e
|
||||
|
||||
CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
|
||||
|
||||
if [ -e /usr/share/defaults/etc/shells ]; then
|
||||
CHECK_ZSH_INSTALLED=$(grep /zsh$ /usr/share/defaults/etc/shells | wc -l)
|
||||
else
|
||||
CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
|
||||
fi
|
||||
|
||||
if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
|
||||
printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
|
||||
exit
|
||||
|
|
@ -86,7 +91,11 @@ main() {
|
|||
# If this platform provides a "chsh" command (not Cygwin), do it, man!
|
||||
if hash chsh >/dev/null 2>&1; then
|
||||
printf "${BLUE}Time to change your default shell to zsh!${NORMAL}\n"
|
||||
chsh -s $(grep /zsh$ /etc/shells | tail -1)
|
||||
if [ -e /usr/share/defaults/etc/shells ]; then
|
||||
chsh -s $(grep /zsh$ /usr/share/defaults/etc/shells | tail -1)
|
||||
else
|
||||
chsh -s $(grep /zsh$ /etc/shells | tail -1)
|
||||
fi
|
||||
# Else, suggest the user do so manually.
|
||||
else
|
||||
printf "I can't change your shell automatically because this system does not have chsh.\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue