diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..f506a9f --- /dev/null +++ b/setup.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +func_def=$(cat <> ~/.bashrc + else + echo "ℹ️ hive_cli function already exists in .bashrc" + fi +elif [ -f ~/.bash_profile ]; then + if [ $(grep -c "function hive_cli()" ~/.bash_profile) -eq 0 ]; then + echo "✅ Adding hive_cli function to .bash_profile ..." + echo "$func_def" >> ~/.bash_profile + else + echo "ℹ️ hive_cli function already exists in .bash_profile" + fi +fi +if [ -f ~/.zshrc ]; then + if [ $(grep -c "function hive_cli()" ~/.zshrc) -eq 0 ]; then + echo "✅ Adding hive_cli function to .zshrc ..." + echo "$func_def" >> ~/.zshrc + else + echo "ℹ️ hive_cli function already exists in .zshrc" + fi +fi + +echo "ℹ️ Please restart your shell or run 'source ~/.bashrc', 'source ~/.zshrc' or 'source ~/.bash_profile'" +echo "ℹ️ To use the function, run 'hive_cli'"