Activate dev checkout before updates

This commit is contained in:
David Heinemeier Hansson
2026-07-23 17:05:29 -07:00
parent ed9e68957f
commit c844277749
3 changed files with 41 additions and 22 deletions
+11 -11
View File
@@ -12,15 +12,12 @@ fail() { echo "Error: $*" >&2; exit 1; }
confirm_dev() {
cat <<'WARNING'
Dev links Omarchy directly to a mutable source checkout.
This disables package-based protections for the Omarchy code path, including
normal package updates and package-backed snapshot restores. You'll be
responsible for pulling, fixing, and restoring that checkout yourself.
The dev channel links Omarchy directly to a checkout of the source in ~/omarchy.
It's exclusively intended for developers working on Omarchy itself.
WARNING
gum confirm --default=false "Enable Dev anyway?"
gum confirm --default=false "Switch to dev channel?"
}
validate_dev_checkout() {
@@ -39,7 +36,7 @@ link_dev_checkout() {
local checkout="$1"
[[ -d $checkout/.git ]] || git clone https://github.com/basecamp/omarchy.git "$checkout"
omarchy-dev-link "$checkout"
omarchy-dev-link "$checkout" --no-reboot
}
(( $# > 0 )) || { usage; exit 1; }
@@ -79,6 +76,13 @@ if [[ -z $dev_checkout && $OMARCHY_PATH != "/usr/share/omarchy" ]]; then
leaving_dev=1
fi
if [[ -n $dev_checkout ]]; then
link_dev_checkout "$dev_checkout"
export OMARCHY_PATH="$dev_checkout"
export PATH="$OMARCHY_PATH/bin:$PATH"
omarchy-state set reboot-required
fi
omarchy-refresh-pacman "$pacman_channel"
# --ask 4 accepts omarchy <-> omarchy-dev replacement prompts without file overwrites.
sudo env OMARCHY_UPDATE_PACMAN=1 pacman -S --needed --noconfirm --ask 4 "${packages[@]}"
@@ -93,7 +97,3 @@ if [[ -z $dev_checkout ]]; then
fi
omarchy-update -y
if [[ -n $dev_checkout ]]; then
link_dev_checkout "$dev_checkout"
fi
+17 -4
View File
@@ -2,7 +2,7 @@
# omarchy:summary=Point Omarchy at a local checkout after reboot
# omarchy:group=dev
# omarchy:args=<path-to-checkout>
# omarchy:args=<path-to-checkout> [--no-reboot]
# omarchy:examples=omarchy dev link ~/omarchy
set -euo pipefail
@@ -12,9 +12,11 @@ if (( EUID == 0 )); then
exit 1
fi
if (( $# != 1 )) || [[ $1 == "-h" || $1 == "--help" ]]; then
prompt_reboot=1
if (( $# < 1 || $# > 2 )) || [[ $1 == "-h" || $1 == "--help" ]]; then
cat <<USAGE
Usage: omarchy dev link <path-to-checkout>
Usage: omarchy dev link <path-to-checkout> [--no-reboot]
Writes /etc/omarchy.conf so OMARCHY_PATH resolves to <path-to-checkout>
after reboot. This intentionally does not rewrite the running Hyprland,
@@ -25,10 +27,21 @@ themes/, applications/, config/. Files installed at fixed system paths
(/etc/, /usr/lib/systemd/, udev rule bodies, /etc/skel after user
creation, /usr/share/plymouth) are NOT covered — for those, use
omarchy-dev-pkg-test to build and install the package from the checkout.
Use --no-reboot when another command will handle the reboot prompt.
USAGE
exit 0
fi
if (( $# == 2 )); then
if [[ $2 == "--no-reboot" ]]; then
prompt_reboot=0
else
echo "Usage: omarchy dev link <path-to-checkout> [--no-reboot]" >&2
exit 1
fi
fi
omarchy_conf_quote() {
local value="$1"
value=${value//\\/\\\\}
@@ -58,6 +71,6 @@ done
echo "Pointed Omarchy at $target"
echo
if gum confirm "Reboot now to activate?"; then
if (( prompt_reboot )) && gum confirm "Reboot now to activate?"; then
omarchy-system-reboot
fi