2021-04-27 20:33:06 +03:00
|
|
|
#! /usr/bin/env bash
|
2021-04-26 16:25:57 +03:00
|
|
|
|
2024-06-26 18:05:32 +03:00
|
|
|
|
2024-03-01 17:54:43 +03:00
|
|
|
if [[ "${BASH_VERSION%%.*}" -eq 3 ]]; then
|
|
|
|
echo "Atuin has limited support for Bash 3.2. The Atuin config enter_accept cannot be turned off." >&2
|
|
|
|
echo "To turn off enter_accept, please upgrade your version of bash (possibly via homebrew or ports)" >&2
|
|
|
|
fi
|
|
|
|
|
2021-04-26 16:25:57 +03:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
cat << EOF
|
2022-04-21 19:26:35 +03:00
|
|
|
_______ _______ __ __ ___ __ _
|
2021-04-26 16:25:57 +03:00
|
|
|
| _ || || | | || | | | | |
|
|
|
|
| |_| ||_ _|| | | || | | |_| |
|
|
|
|
| | | | | |_| || | | |
|
|
|
|
| | | | | || | | _ |
|
|
|
|
| _ | | | | || | | | | |
|
|
|
|
|__| |__| |___| |_______||___| |_| |__|
|
|
|
|
|
|
|
|
Magical shell history
|
|
|
|
|
|
|
|
Atuin setup
|
2023-07-31 01:08:00 +03:00
|
|
|
https://github.com/atuinsh/atuin
|
2024-06-26 18:05:32 +03:00
|
|
|
https://forum.atuin.sh
|
2021-04-26 16:25:57 +03:00
|
|
|
|
2024-06-26 18:05:32 +03:00
|
|
|
Please file an issue or reach out on the forum if you encounter any problems!
|
2021-04-26 16:25:57 +03:00
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2024-06-26 18:05:32 +03:00
|
|
|
__atuin_install_binary(){
|
|
|
|
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/latest/download/atuin-installer.sh | sh
|
|
|
|
}
|
|
|
|
|
2021-12-09 02:21:41 +03:00
|
|
|
if ! command -v curl &> /dev/null; then
|
|
|
|
echo "curl not installed. Please install curl."
|
|
|
|
exit
|
|
|
|
elif ! command -v sed &> /dev/null; then
|
|
|
|
echo "sed not installed. Please install sed."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2021-04-26 16:25:57 +03:00
|
|
|
|
2024-06-26 18:05:32 +03:00
|
|
|
__atuin_install_binary
|
2021-04-26 17:46:47 +03:00
|
|
|
|
2021-05-14 10:31:15 +03:00
|
|
|
# TODO: Check which shell is in use
|
|
|
|
# Use of single quotes around $() is intentional here
|
|
|
|
# shellcheck disable=SC2016
|
2023-12-12 13:03:22 +03:00
|
|
|
if ! grep -q "atuin init zsh" "${ZDOTDIR:-$HOME}/.zshrc"; then
|
2023-12-09 20:52:09 +03:00
|
|
|
printf '\neval "$(atuin init zsh)"\n' >> "${ZDOTDIR:-$HOME}/.zshrc"
|
2023-08-16 11:15:35 +03:00
|
|
|
fi
|
2021-04-26 17:46:47 +03:00
|
|
|
|
2021-05-14 10:31:15 +03:00
|
|
|
# Use of single quotes around $() is intentional here
|
|
|
|
# shellcheck disable=SC2016
|
2023-08-16 11:15:35 +03:00
|
|
|
|
|
|
|
if ! grep -q "atuin init bash" ~/.bashrc; then
|
|
|
|
curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh
|
|
|
|
printf '\n[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh\n' >> ~/.bashrc
|
|
|
|
echo 'eval "$(atuin init bash)"' >> ~/.bashrc
|
|
|
|
fi
|
2022-10-15 09:29:37 +03:00
|
|
|
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_______ __ __ _______ __ _ ___ _ __ __ _______ __ __
|
|
|
|
| || | | || _ || | | || | | | | | | || || | | |
|
|
|
|
|_ _|| |_| || |_| || |_| || |_| | | |_| || _ || | | |
|
|
|
|
| | | || || || _| | || | | || |_| |
|
|
|
|
| | | || || _ || |_ |_ _|| |_| || |
|
|
|
|
| | | _ || _ || | | || _ | | | | || |
|
|
|
|
|___| |__| |__||__| |__||_| |__||___| |_| |___| |_______||_______|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thanks for installing Atuin! I really hope you like it.
|
|
|
|
|
2024-06-26 18:05:32 +03:00
|
|
|
If you have any issues, please open an issue on GitHub or visit our forum (https://forum.atuin.sh)!
|
2022-10-15 09:29:37 +03:00
|
|
|
|
2023-07-31 01:08:00 +03:00
|
|
|
If you love Atuin, please give us a star on GitHub! It really helps ⭐️ https://github.com/atuinsh/atuin
|
2022-10-15 09:29:37 +03:00
|
|
|
|
2023-07-31 01:08:00 +03:00
|
|
|
Please run "atuin register" to get setup with sync, or "atuin login" if you already have an account
|
2022-10-15 09:29:37 +03:00
|
|
|
|
|
|
|
EOF
|
2024-06-26 18:05:32 +03:00
|
|
|
|