From d41cc76dcec54af302ded9806166de435893e24a Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Thu, 4 Jul 2024 00:09:10 -0700 Subject: [PATCH 1/4] Make boot.sh and boot-dev.sh executable --- boot-dev.sh | 0 boot.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 boot-dev.sh mode change 100644 => 100755 boot.sh diff --git a/boot-dev.sh b/boot-dev.sh old mode 100644 new mode 100755 diff --git a/boot.sh b/boot.sh old mode 100644 new mode 100755 From 1767107038f40ed8aa2e7f932392d7f67933fcfa Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Thu, 4 Jul 2024 00:09:19 -0700 Subject: [PATCH 2/4] Generalize boot.sh to support running any ref This will enable running not only the `master` and `stable` branches, but also unmerged commits, so that we can easily test them. --- boot-dev.sh | 25 ++----------------------- boot.sh | 7 +++++-- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/boot-dev.sh b/boot-dev.sh index b8481783..5ae834c7 100755 --- a/boot-dev.sh +++ b/boot-dev.sh @@ -1,23 +1,2 @@ -set -e - -ascii_art='________ __ ___. -\_____ \ _____ _____ | | ____ _\_ |__ - / | \ / \\__ \ | |/ / | \ __ \ -/ | \ Y Y \/ __ \| <| | / \_\ \ -\_______ /__|_| (____ /__|_ \____/|___ / - \/ \/ \/ \/ \/ -' - -echo -e "$ascii_art" -echo "=> Omakub is for fresh Ubuntu 24.04 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 - -echo "Installation starting..." -source ~/.local/share/omakub/install.sh +OMAKUB_REF="master" +source ./boot.sh diff --git a/boot.sh b/boot.sh index 7ba7fe87..4dc374c4 100755 --- a/boot.sh +++ b/boot.sh @@ -15,9 +15,12 @@ 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 stable Omakub..." +echo "Cloning Omakub..." rm -rf ~/.local/share/omakub -git clone -b stable https://github.com/basecamp/omakub.git ~/.local/share/omakub >/dev/null +git clone https://github.com/basecamp/omakub.git ~/.local/share/omakub >/dev/null +cd ~/.local/share/omakub +git fetch origin "${OMAKUB_REF:-stable}" && git checkout FETCH_HEAD +cd - echo "Installation starting..." source ~/.local/share/omakub/install.sh From ebc6863740190898a4e42991c454823e1593e225 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Thu, 4 Jul 2024 00:09:26 -0700 Subject: [PATCH 3/4] Avoid unnecessary git commands if `OMAKUB_REF` is `master` Otherwise it'd try to check out the branch it's already on. --- boot.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/boot.sh b/boot.sh index 4dc374c4..97f0884a 100755 --- a/boot.sh +++ b/boot.sh @@ -18,9 +18,11 @@ 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 -cd ~/.local/share/omakub -git fetch origin "${OMAKUB_REF:-stable}" && git checkout FETCH_HEAD -cd - +if [[ $OMAKUB_REF != "master" ]]; then + cd ~/.local/share/omakub + git fetch origin "${OMAKUB_REF:-stable}" && git checkout FETCH_HEAD + cd - +fi echo "Installation starting..." source ~/.local/share/omakub/install.sh From 2f1544548d8709f61e9e6aac5e222b000770898b Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Thu, 4 Jul 2024 00:09:57 -0700 Subject: [PATCH 4/4] Remove no-longer-needed boot-dev.sh The only unique part here was setting `OMAKUB_REF`, but we can do that instead in https://github.com/basecamp/omakub-site/blob/32701d97e88e7e4b10c0abd35194e602b1dbd5d7/install-dev --- boot-dev.sh | 2 -- 1 file changed, 2 deletions(-) delete mode 100755 boot-dev.sh diff --git a/boot-dev.sh b/boot-dev.sh deleted file mode 100755 index 5ae834c7..00000000 --- a/boot-dev.sh +++ /dev/null @@ -1,2 +0,0 @@ -OMAKUB_REF="master" -source ./boot.sh