Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hacky try #175

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,9 @@ check_shell_magic() {
;;
bash)
__TEA_SH_FILE="$HOME/.bashrc"
__TEA_BTN_TXT="add one-liner to your \`~/.bashrc\`?"
__TEA_ONE_LINER="test -d \"$TEA_DESTDIR_WRITABLE\" && source /dev/stdin <<<\"\$(\"$TEA_DESTDIR_WRITABLE/tea.xyz/v*/bin/tea\" --magic=$SHELL --silent)\""
__TEA_SH_FILE2="$HOME/.bash_profile"
__TEA_BTN_TXT="add one-liner to your \`~/.bashrc\` and \`~/.bash_profile\`?"
__TEA_ONE_LINER="test -d \"$TEA_DESTDIR_WRITABLE\" && test \"$TEA_HAS_RUN\" != 1 && source /dev/stdin <<<\"\$(\"$TEA_DESTDIR_WRITABLE/tea.xyz/v*/bin/tea\" --magic=$SHELL --silent)\" && export TEA_HAS_RUN=1"
;;
elvish)
__TEA_SH_FILE="$HOME/.config/elvish/rc.elv"
Expand Down Expand Up @@ -478,6 +479,13 @@ check_shell_magic() {
echo >> "$__TEA_SH_FILE"
echo "$__TEA_ONE_LINER" >> "$__TEA_SH_FILE"

if test -z "$__TEA_SH_FILE2"; then
if test ! -f "$__TEA_SH_FILE2" || ! command -v grep >/dev/null || ! grep --fixed-strings "$__TEA_ONE_LINER" "$__TEA_SH_FILE2" --silent; then
echo >> "$__TEA_SH_FILE2"
echo "$__TEA_ONE_LINER" >> "$__TEA_SH_FILE2"
fi
fi

echo #spacer

gum_func format -- <<-EoMD
Expand Down