diff --git a/default/bashrc b/default/bashrc index f9ea4fd4..eaf13c66 100644 --- a/default/bashrc +++ b/default/bashrc @@ -1,3 +1,6 @@ +# If not running interactively, don't do anything (leave this at the top of this file) +[[ $- != *i* ]] && return + # All the default Omarchy aliases and functions # (don't mess with these directly, just overwrite them here!) source ~/.local/share/omarchy/default/bash/rc diff --git a/migrations/1761180745.sh b/migrations/1761180745.sh new file mode 100644 index 00000000..5a6b1e0f --- /dev/null +++ b/migrations/1761180745.sh @@ -0,0 +1,7 @@ +echo "Ensure interactive shell check is at the top of .bashrc" + +BASHRC="$HOME/.bashrc" + +if [ -f "$BASHRC" ] && ! grep -q '\[\[ $- != \*i\* \]\] && return' "$BASHRC"; then + sed -i '1i# If not running interactively, don'\''t do anything (leave this at the top of this file)\n[[ $- != *i* ]] && return\n' "$BASHRC" +fi