Rename live dev channel to edge
This commit is contained in:
@@ -21,7 +21,7 @@ if pacman -Q omarchy-dev omarchy-settings-dev >/dev/null 2>&1; then
|
|||||||
if [[ $omarchy_path == "/usr/share/omarchy" ]]; then
|
if [[ $omarchy_path == "/usr/share/omarchy" ]]; then
|
||||||
echo dev
|
echo dev
|
||||||
else
|
else
|
||||||
echo live-dev
|
echo edge
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*) echo unknown ;;
|
*) echo unknown ;;
|
||||||
|
|||||||
+19
-19
@@ -1,18 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# omarchy:summary=Set the Omarchy package channel.
|
# omarchy:summary=Set the Omarchy package channel.
|
||||||
# omarchy:args=<stable|rc|dev|live-dev>
|
# omarchy:args=<stable|rc|dev|edge>
|
||||||
# omarchy:requires-sudo=true
|
# omarchy:requires-sudo=true
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
usage() { echo "Usage: omarchy-channel-set [stable|rc|dev|live-dev]"; }
|
usage() { echo "Usage: omarchy-channel-set [stable|rc|dev|edge]"; }
|
||||||
fail() { echo "Error: $*" >&2; exit 1; }
|
fail() { echo "Error: $*" >&2; exit 1; }
|
||||||
|
|
||||||
confirm_live_dev() {
|
confirm_edge() {
|
||||||
cat <<'WARNING'
|
cat <<'WARNING'
|
||||||
|
|
||||||
Live Dev links Omarchy directly to a mutable source checkout.
|
Edge links Omarchy directly to a mutable source checkout.
|
||||||
|
|
||||||
This disables package-based protections for the Omarchy code path, including
|
This disables package-based protections for the Omarchy code path, including
|
||||||
normal package updates and package-backed snapshot restores. You'll be
|
normal package updates and package-backed snapshot restores. You'll be
|
||||||
@@ -21,23 +21,23 @@ responsible for pulling, fixing, and restoring that checkout yourself.
|
|||||||
WARNING
|
WARNING
|
||||||
|
|
||||||
if omarchy-cmd-present gum; then
|
if omarchy-cmd-present gum; then
|
||||||
gum confirm --default=false "Enable Live Dev anyway?"
|
gum confirm --default=false "Enable Edge anyway?"
|
||||||
else
|
else
|
||||||
local answer=""
|
local answer=""
|
||||||
read -r -p "Enable Live Dev anyway? [y/N] " answer
|
read -r -p "Enable Edge anyway? [y/N] " answer
|
||||||
[[ $answer == "y" || $answer == "Y" || $answer == "yes" || $answer == "YES" ]]
|
[[ $answer == "y" || $answer == "Y" || $answer == "yes" || $answer == "YES" ]]
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
choose_live_dev_checkout() {
|
choose_edge_checkout() {
|
||||||
local default_path="$HOME/Work/omarchy"
|
local default_path="$HOME/Work/omarchy"
|
||||||
local path="${OMARCHY_LIVE_DEV_PATH:-}"
|
local path="${OMARCHY_EDGE_PATH:-}"
|
||||||
|
|
||||||
if [[ -z $path ]]; then
|
if [[ -z $path ]]; then
|
||||||
if omarchy-cmd-present gum; then
|
if omarchy-cmd-present gum; then
|
||||||
path=$(gum input --value "$default_path" --placeholder "$default_path" --header "Where should Live Dev checkout live? Existing non-checkout paths will not be overwritten.") || exit 1
|
path=$(gum input --value "$default_path" --placeholder "$default_path" --header "Where should Edge checkout live? Existing non-checkout paths will not be overwritten.") || exit 1
|
||||||
else
|
else
|
||||||
read -r -p "Live Dev checkout path [$default_path]: " path
|
read -r -p "Edge checkout path [$default_path]: " path
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -60,11 +60,11 @@ choose_live_dev_checkout() {
|
|||||||
printf '%s\n' "$path"
|
printf '%s\n' "$path"
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_live_dev_checkout() {
|
sync_edge_checkout() {
|
||||||
local checkout="$1"
|
local checkout="$1"
|
||||||
|
|
||||||
if [[ -d $checkout/.git ]]; then
|
if [[ -d $checkout/.git ]]; then
|
||||||
echo "Updating Live Dev checkout at $checkout"
|
echo "Updating Edge checkout at $checkout"
|
||||||
git -C "$checkout" fetch origin quattro
|
git -C "$checkout" fetch origin quattro
|
||||||
git -C "$checkout" checkout quattro 2>/dev/null || git -C "$checkout" checkout --track origin/quattro
|
git -C "$checkout" checkout quattro 2>/dev/null || git -C "$checkout" checkout --track origin/quattro
|
||||||
git -C "$checkout" pull --ff-only origin quattro
|
git -C "$checkout" pull --ff-only origin quattro
|
||||||
@@ -78,7 +78,7 @@ sync_live_dev_checkout() {
|
|||||||
|
|
||||||
(( $# > 0 )) || { usage; exit 1; }
|
(( $# > 0 )) || { usage; exit 1; }
|
||||||
|
|
||||||
live_dev_checkout=""
|
edge_checkout=""
|
||||||
channel="$1"
|
channel="$1"
|
||||||
|
|
||||||
case "$channel" in
|
case "$channel" in
|
||||||
@@ -94,9 +94,9 @@ case "$channel" in
|
|||||||
pacman_channel=edge
|
pacman_channel=edge
|
||||||
packages=(omarchy-dev omarchy-settings-dev)
|
packages=(omarchy-dev omarchy-settings-dev)
|
||||||
;;
|
;;
|
||||||
live-dev|live|source)
|
edge|source)
|
||||||
confirm_live_dev || { echo "Cancelled."; exit 0; }
|
confirm_edge || { echo "Cancelled."; exit 0; }
|
||||||
live_dev_checkout=$(choose_live_dev_checkout)
|
edge_checkout=$(choose_edge_checkout)
|
||||||
pacman_channel=edge
|
pacman_channel=edge
|
||||||
packages=(omarchy-dev omarchy-settings-dev)
|
packages=(omarchy-dev omarchy-settings-dev)
|
||||||
;;
|
;;
|
||||||
@@ -111,13 +111,13 @@ omarchy-refresh-pacman "$pacman_channel"
|
|||||||
# --ask 4 accepts omarchy <-> omarchy-dev replacement prompts without file overwrites.
|
# --ask 4 accepts omarchy <-> omarchy-dev replacement prompts without file overwrites.
|
||||||
sudo env OMARCHY_UPDATE_PACMAN=1 pacman -S --needed --noconfirm --ask 4 "${packages[@]}"
|
sudo env OMARCHY_UPDATE_PACMAN=1 pacman -S --needed --noconfirm --ask 4 "${packages[@]}"
|
||||||
|
|
||||||
if [[ -z $live_dev_checkout ]] && omarchy-cmd-present omarchy-dev-unlink; then
|
if [[ -z $edge_checkout ]] && omarchy-cmd-present omarchy-dev-unlink; then
|
||||||
omarchy-dev-unlink
|
omarchy-dev-unlink
|
||||||
export OMARCHY_PATH=/usr/share/omarchy
|
export OMARCHY_PATH=/usr/share/omarchy
|
||||||
fi
|
fi
|
||||||
|
|
||||||
omarchy-update -y
|
omarchy-update -y
|
||||||
|
|
||||||
if [[ -n $live_dev_checkout ]]; then
|
if [[ -n $edge_checkout ]]; then
|
||||||
sync_live_dev_checkout "$live_dev_checkout"
|
sync_edge_checkout "$edge_checkout"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -284,7 +284,7 @@
|
|||||||
|
|
||||||
// Update
|
// Update
|
||||||
"update.omarchy": {"icon":"","label":"Omarchy","keywords":"system","action":"omarchy-launch-floating-terminal-with-presentation omarchy-update"},
|
"update.omarchy": {"icon":"","label":"Omarchy","keywords":"system","action":"omarchy-launch-floating-terminal-with-presentation omarchy-update"},
|
||||||
"update.channel": {"icon":"","label":"Channel","keywords":"stable rc dev live source"},
|
"update.channel": {"icon":"","label":"Channel","keywords":"stable rc dev edge source"},
|
||||||
"update.config": {"icon":"","label":"Config","keywords":"refresh default"},
|
"update.config": {"icon":"","label":"Config","keywords":"refresh default"},
|
||||||
"update.themes": {"icon":"","label":"Extra Themes","action":"omarchy-launch-floating-terminal-with-presentation omarchy-theme-update"},
|
"update.themes": {"icon":"","label":"Extra Themes","action":"omarchy-launch-floating-terminal-with-presentation omarchy-theme-update"},
|
||||||
"update.process": {"icon":"","label":"Process","keywords":"restart services"},
|
"update.process": {"icon":"","label":"Process","keywords":"restart services"},
|
||||||
@@ -296,7 +296,7 @@
|
|||||||
"update.channel.stable": {"icon":"🟢","label":"Stable","checked":"[[ \"$(omarchy-channel-current)\" == \"stable\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set stable'"},
|
"update.channel.stable": {"icon":"🟢","label":"Stable","checked":"[[ \"$(omarchy-channel-current)\" == \"stable\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set stable'"},
|
||||||
"update.channel.rc": {"icon":"🟡","label":"RC","keywords":"release candidate","checked":"[[ \"$(omarchy-channel-current)\" == \"rc\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set rc'"},
|
"update.channel.rc": {"icon":"🟡","label":"RC","keywords":"release candidate","checked":"[[ \"$(omarchy-channel-current)\" == \"rc\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set rc'"},
|
||||||
"update.channel.dev": {"icon":"🟠","label":"Dev","keywords":"development","checked":"[[ \"$(omarchy-channel-current)\" == \"dev\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set dev'"},
|
"update.channel.dev": {"icon":"🟠","label":"Dev","keywords":"development","checked":"[[ \"$(omarchy-channel-current)\" == \"dev\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set dev'"},
|
||||||
"update.channel.live-dev": {"icon":"🔴","label":"Live Dev","keywords":"source mode development quattro","checked":"[[ \"$(omarchy-channel-current)\" == \"live-dev\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set live-dev'"},
|
"update.channel.edge": {"icon":"🔴","label":"Edge","keywords":"source mode development quattro","checked":"[[ \"$(omarchy-channel-current)\" == \"edge\" ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-channel-set edge'"},
|
||||||
"update.process.hyprsunset": {"icon":"","label":"Hyprsunset","keywords":"restart","action":"omarchy-restart-hyprsunset"},
|
"update.process.hyprsunset": {"icon":"","label":"Hyprsunset","keywords":"restart","action":"omarchy-restart-hyprsunset"},
|
||||||
"update.process.osd": {"icon":"","label":"OSD","keywords":"restart","action":"omarchy-restart-shell"},
|
"update.process.osd": {"icon":"","label":"OSD","keywords":"restart","action":"omarchy-restart-shell"},
|
||||||
"update.process.shell": {"icon":"","label":"Shell","keywords":"restart bar quickshell omarchy-shell","action":"omarchy-restart-shell"},
|
"update.process.shell": {"icon":"","label":"Shell","keywords":"restart bar quickshell omarchy-shell","action":"omarchy-restart-shell"},
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ esac
|
|||||||
run_channel() {
|
run_channel() {
|
||||||
: >"$log_file"
|
: >"$log_file"
|
||||||
OMARCHY_CHANNEL_TEST_LOG="$log_file" \
|
OMARCHY_CHANNEL_TEST_LOG="$log_file" \
|
||||||
OMARCHY_LIVE_DEV_PATH="${OMARCHY_LIVE_DEV_PATH:-}" \
|
OMARCHY_EDGE_PATH="${OMARCHY_EDGE_PATH:-}" \
|
||||||
OMARCHY_TEST_GUM_INPUT="${OMARCHY_TEST_GUM_INPUT:-}" \
|
OMARCHY_TEST_GUM_INPUT="${OMARCHY_TEST_GUM_INPUT:-}" \
|
||||||
OMARCHY_PATH="$ROOT" \
|
OMARCHY_PATH="$ROOT" \
|
||||||
HOME="$test_tmp/home" \
|
HOME="$test_tmp/home" \
|
||||||
@@ -134,35 +134,28 @@ assert_log_line $'refresh\tedge' "dev refreshes the edge pacman channel"
|
|||||||
assert_log_line $'sudo\tenv\tOMARCHY_UPDATE_PACMAN=1\tpacman\t-S\t--needed\t--noconfirm\t--ask\t4\tomarchy-dev\tomarchy-settings-dev' "dev installs development Omarchy packages"
|
assert_log_line $'sudo\tenv\tOMARCHY_UPDATE_PACMAN=1\tpacman\t-S\t--needed\t--noconfirm\t--ask\t4\tomarchy-dev\tomarchy-settings-dev' "dev installs development Omarchy packages"
|
||||||
assert_log_line 'unlink' "dev remains package-backed"
|
assert_log_line 'unlink' "dev remains package-backed"
|
||||||
|
|
||||||
checkout="$test_tmp/live-checkout"
|
checkout="$test_tmp/edge-checkout"
|
||||||
default_checkout="$test_tmp/home/Work/omarchy"
|
default_checkout="$test_tmp/home/Work/omarchy"
|
||||||
OMARCHY_TEST_GUM_INPUT="$checkout" run_channel live-dev
|
OMARCHY_TEST_GUM_INPUT="$checkout" run_channel edge
|
||||||
assert_numbered_log_line 1 $'gum\tconfirm\t--default=false\tEnable Live Dev anyway?' "live dev warns before changing packages"
|
assert_numbered_log_line 1 $'gum\tconfirm\t--default=false\tEnable Edge anyway?' "edge warns before changing packages"
|
||||||
assert_numbered_log_line 2 $'gum\tinput\t--value\t'"$default_checkout"$'\t--placeholder\t'"$default_checkout"$'\t--header\tWhere should Live Dev checkout live? Existing non-checkout paths will not be overwritten.' "live dev prompts for the checkout path before changing packages"
|
assert_numbered_log_line 2 $'gum\tinput\t--value\t'"$default_checkout"$'\t--placeholder\t'"$default_checkout"$'\t--header\tWhere should Edge checkout live? Existing non-checkout paths will not be overwritten.' "edge prompts for the checkout path before changing packages"
|
||||||
assert_log_line $'gum\tconfirm\t--default=false\tEnable Live Dev anyway?' "live dev asks for confirmation"
|
assert_log_line $'gum\tconfirm\t--default=false\tEnable Edge anyway?' "edge asks for confirmation"
|
||||||
assert_log_line $'refresh\tedge' "live dev refreshes the edge pacman channel"
|
assert_log_line $'refresh\tedge' "edge refreshes the edge pacman channel"
|
||||||
assert_log_line $'sudo\tenv\tOMARCHY_UPDATE_PACMAN=1\tpacman\t-S\t--needed\t--noconfirm\t--ask\t4\tomarchy-dev\tomarchy-settings-dev' "live dev installs development Omarchy packages"
|
assert_log_line $'sudo\tenv\tOMARCHY_UPDATE_PACMAN=1\tpacman\t-S\t--needed\t--noconfirm\t--ask\t4\tomarchy-dev\tomarchy-settings-dev' "edge installs development Omarchy packages"
|
||||||
assert_log_line $'git\tclone\t--branch\tquattro\t--single-branch\thttps://github.com/basecamp/omarchy.git\t'"$checkout" "live dev clones the quattro checkout"
|
assert_log_line $'git\tclone\t--branch\tquattro\t--single-branch\thttps://github.com/basecamp/omarchy.git\t'"$checkout" "edge clones the quattro checkout"
|
||||||
assert_log_line $'link\t'"$checkout" "live dev links the source checkout"
|
assert_log_line $'link\t'"$checkout" "edge links the source checkout"
|
||||||
|
|
||||||
occupied_checkout="$test_tmp/occupied"
|
occupied_checkout="$test_tmp/occupied"
|
||||||
mkdir -p "$occupied_checkout"
|
mkdir -p "$occupied_checkout"
|
||||||
if OMARCHY_TEST_GUM_INPUT="$occupied_checkout" run_channel live-dev >"$test_tmp/occupied.out" 2>"$test_tmp/occupied.err"; then
|
if OMARCHY_TEST_GUM_INPUT="$occupied_checkout" run_channel edge >"$test_tmp/occupied.out" 2>"$test_tmp/occupied.err"; then
|
||||||
fail "live dev refuses to use an occupied non-checkout path"
|
fail "edge refuses to use an occupied non-checkout path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
grep -q "already exists and is not a git checkout" "$test_tmp/occupied.err" || fail "live dev explains occupied checkout paths" "$(cat "$test_tmp/occupied.err")"
|
grep -q "already exists and is not a git checkout" "$test_tmp/occupied.err" || fail "edge explains occupied checkout paths" "$(cat "$test_tmp/occupied.err")"
|
||||||
if grep -Fx $'refresh\tedge' "$log_file" >/dev/null; then
|
if grep -Fx $'refresh\tedge' "$log_file" >/dev/null; then
|
||||||
fail "live dev validates checkout path before changing packages" "$(cat "$log_file")"
|
fail "edge validates checkout path before changing packages" "$(cat "$log_file")"
|
||||||
fi
|
fi
|
||||||
pass "live dev refuses occupied non-checkout paths before package changes"
|
pass "edge refuses occupied non-checkout paths before package changes"
|
||||||
|
|
||||||
if run_channel edge >"$test_tmp/edge.out" 2>"$test_tmp/edge.err"; then
|
|
||||||
fail "edge is no longer accepted as a channel"
|
|
||||||
fi
|
|
||||||
|
|
||||||
grep -q "Unknown channel: edge" "$test_tmp/edge.err" || fail "edge rejection explains the invalid channel" "$(cat "$test_tmp/edge.err")"
|
|
||||||
pass "edge is no longer accepted as a channel"
|
|
||||||
|
|
||||||
current_channel() {
|
current_channel() {
|
||||||
OMARCHY_TEST_VERSION_CHANNEL="$1" \
|
OMARCHY_TEST_VERSION_CHANNEL="$1" \
|
||||||
@@ -182,10 +175,10 @@ pass "current channel detects rc"
|
|||||||
[[ $(current_channel edge dev /dev/null /usr/share/omarchy) == "dev" ]] || fail "current channel detects package-backed dev"
|
[[ $(current_channel edge dev /dev/null /usr/share/omarchy) == "dev" ]] || fail "current channel detects package-backed dev"
|
||||||
pass "current channel detects package-backed dev"
|
pass "current channel detects package-backed dev"
|
||||||
|
|
||||||
[[ $(current_channel edge dev /dev/null "$test_tmp/live-checkout") == "live-dev" ]] || fail "current channel detects live dev from OMARCHY_PATH"
|
[[ $(current_channel edge dev /dev/null "$test_tmp/edge-checkout") == "edge" ]] || fail "current channel detects edge from OMARCHY_PATH"
|
||||||
pass "current channel detects live dev from OMARCHY_PATH"
|
pass "current channel detects edge from OMARCHY_PATH"
|
||||||
|
|
||||||
conf="$test_tmp/omarchy.conf"
|
conf="$test_tmp/omarchy.conf"
|
||||||
printf 'export OMARCHY_PATH="%s"\n' "$test_tmp/live-checkout" >"$conf"
|
printf 'export OMARCHY_PATH="%s"\n' "$test_tmp/edge-checkout" >"$conf"
|
||||||
[[ $(current_channel edge dev "$conf" /usr/share/omarchy) == "live-dev" ]] || fail "current channel detects live dev from configured path"
|
[[ $(current_channel edge dev "$conf" /usr/share/omarchy) == "edge" ]] || fail "current channel detects edge from configured path"
|
||||||
pass "current channel detects live dev from configured path"
|
pass "current channel detects edge from configured path"
|
||||||
|
|||||||
Reference in New Issue
Block a user