oh-my-bash: Show warning and fail for non-interactive shells

Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
This commit is contained in:
Jacob Hrbek
2019-07-24 03:00:45 +02:00
committed by Koichi Murase
parent e84ace339b
commit 31f095f3ac

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Bail out early if non-interactive # Bail out early if non-interactive
case $- in if [[ $- != *i* ]]; then
*i*) ;; printf 'oh-my-bash: Shell is not interactive.\n' >&2
*) return;; return 1
esac fi
# Check for updates on initial load... # Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then