Skip to content

Commit

Permalink
refactor: implement my opinionated flow
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehsiao committed Nov 21, 2024
1 parent 09784a0 commit 7a8f4dd
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 48 deletions.
32 changes: 12 additions & 20 deletions boot.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
set -e

ascii_art='________ __ ___.
\_____ \ _____ _____ | | ____ _\_ |__
/ | \ / \\__ \ | |/ / | \ __ \
/ | \ Y Y \/ __ \| <| | / \_\ \
\_______ /__|_| (____ /__|_ \____/|___ /
\/ \/ \/ \/ \/
'
ascii_art=$(cat <<'EOF'
_ _ _ __ _
___ _ __ __ _| |____ _ ___ ___ ___| |__| |_ _ ___ / _(_)_ _
/ _ \ ' \/ _` | / / _` (_-</ -_)___| '_ \ | || / -_) _| | ' \
\___/_|_|_\__,_|_\_\__,_/__/\___| |_.__/_|\_,_\___|_| |_|_||_|
EOF
)

echo -e "$ascii_art"
echo "=> Omakub is for fresh Ubuntu 24.04 installations only!"
echo "=> omakase-bluefin is for fresh bluefin-stable installations only!"
echo -e "\nBegin installation (or abort with ctrl+c)..."

sudo apt-get update >/dev/null
sudo apt-get install -y git >/dev/null

echo "Cloning Omakub..."
rm -rf ~/.local/share/omakub
git clone https://github.com/basecamp/omakub.git ~/.local/share/omakub >/dev/null
if [[ $OMAKUB_REF != "master" ]]; then
cd ~/.local/share/omakub
git fetch origin "${OMAKUB_REF:-stable}" && git checkout "${OMAKUB_REF:-stable}"
cd -
fi
echo "Cloning omakase-bluefin..."
rm -rf ~/.local/share/omakase-bluefin
git clone https://github.com/lukehsiao/omakase-bluefin.git ~/.local/share/omakase-bluefin>/dev/null

echo "Installation starting..."
source ~/.local/share/omakub/install.sh
source ~/.local/share/omakase-bluefin/install.sh
4 changes: 2 additions & 2 deletions install/check-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ fi
. /etc/os-release

# Check if running on Ubuntu 24.04 or higher
if [ "$ID" != "ubuntu" ] || [ $(echo "$VERSION_ID >= 24.04" | bc) != 1 ]; then
if [ "$ID" != "bluefin" ] || [ $(echo "$VERSION_ID >= 41" | bc) != 1 ]; then
echo "$(tput setaf 1)Error: OS requirement not met"
echo "You are currently running: $ID $VERSION_ID"
echo "OS required: Ubuntu 24.04 or higher"
echo "OS required: Bluefin 41 or higher"
echo "Installation stopped."
exit 1
fi
6 changes: 3 additions & 3 deletions install/first-run-choices.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
OPTIONAL_APPS=("1password" "Spotify" "Zoom" "Dropbox")
DEFAULT_OPTIONAL_APPS='1password,Spotify,Zoom'
DEFAULT_OPTIONAL_APPS='Spotify,Zoom'
export OMAKUB_FIRST_RUN_OPTIONAL_APPS=$(gum choose "${OPTIONAL_APPS[@]}" --no-limit --selected $DEFAULT_OPTIONAL_APPS --height 7 --header "Select optional apps" | tr ' ' '-')

AVAILABLE_LANGUAGES=("Ruby on Rails" "Node.js" "Go" "PHP" "Python" "Elixir" "Rust" "Java")
SELECTED_LANGUAGES="Ruby on Rails","Node.js"
SELECTED_LANGUAGES="Rust","Python"
export OMAKUB_FIRST_RUN_LANGUAGES=$(gum choose "${AVAILABLE_LANGUAGES[@]}" --no-limit --selected "$SELECTED_LANGUAGES" --height 10 --header "Select programming languages")

AVAILABLE_DBS=("MySQL" "Redis" "PostgreSQL")
SELECTED_DBS="MySQL,Redis"
SELECTED_DBS="PostgreSQL,Redis"
export OMAKUB_FIRST_RUN_DBS=$(gum choose "${AVAILABLE_DBS[@]}" --no-limit --selected "$SELECTED_DBS" --height 5 --header "Select databases (runs in Docker)")
4 changes: 1 addition & 3 deletions install/terminal.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Needed for all installers
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y curl git unzip
brew install curl unzip

# Run terminal installers
for installer in ~/.local/share/omakub/install/terminal/*.sh; do source $installer; done
1 change: 0 additions & 1 deletion install/terminal/optional/app-ollama.sh

This file was deleted.

9 changes: 2 additions & 7 deletions install/terminal/required/app-gum.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
# Gum is used for the Omakub commands for tailoring Omakub after the initial install
cd /tmp
GUM_VERSION="0.14.3" # Use known good version
wget -qO gum.deb "https://github.com/charmbracelet/gum/releases/download/v${GUM_VERSION}/gum_${GUM_VERSION}_amd64.deb"
sudo apt-get install -y ./gum.deb
rm gum.deb
cd -
# Gum is used for the omakase-bluefin commands for tailoring omakase-bluefin after the initial install
brew install gum
12 changes: 0 additions & 12 deletions uninstall/app-ollama.sh

This file was deleted.

0 comments on commit 7a8f4dd

Please sign in to comment.