Merge pull request #1 from FloopCZ/feature/batch-mode

Make the batch mode work even in Docker environment
This commit is contained in:
loket 2017-10-31 22:34:51 +01:00 committed by GitHub
commit 4d5fa086bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ check_optional_args() {
case "$arg" in case "$arg" in
--batch) --batch)
LAUNCH_ZSH_AFTER=0 LAUNCH_ZSH_AFTER=0
printf "${BLUE}--batch:${NORMAL} zsh will not be started after installation\n" printf "%s\n" "${BLUE}--batch:${NORMAL} zsh will not be started after installation"
;; ;;
*) *)
printf "${YELLOW}Unrecognized argument: ${BLUE}${arg}${NORMAL}\n" printf "${YELLOW}Unrecognized argument: ${BLUE}${arg}${NORMAL}\n"
@ -101,7 +101,7 @@ main() {
mv -f ~/.zshrc-omztemp ~/.zshrc mv -f ~/.zshrc-omztemp ~/.zshrc
# If this user's login shell is not already "zsh", attempt to switch. # If this user's login shell is not already "zsh", attempt to switch.
TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') TEST_CURRENT_SHELL=$(expr "${SHELL:=/bin/false}" : '.*/\(.*\)')
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
# If this platform provides a "chsh" command (not Cygwin), do it, man! # If this platform provides a "chsh" command (not Cygwin), do it, man!
if hash chsh >/dev/null 2>&1; then if hash chsh >/dev/null 2>&1; then