1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 17:55:08 +00:00

Improve update checks and cleanup UX, add timeout regressions

This commit is contained in:
tw93
2026-03-05 12:00:07 +08:00
parent fbee8da9f7
commit 8e4b8a5e0d
21 changed files with 948 additions and 164 deletions

12
mole
View File

@@ -88,7 +88,11 @@ is_homebrew_install() {
}
get_install_channel() {
local channel_file="$SCRIPT_DIR/install_channel"
# Try user config dir first (matches install.sh behavior), fallback to SCRIPT_DIR
local channel_file="${MOLE_CONFIG_DIR:-$HOME/.config/mole}/install_channel"
if [[ ! -f "$channel_file" ]]; then
channel_file="$SCRIPT_DIR/install_channel"
fi
local channel="stable"
if [[ -f "$channel_file" ]]; then
channel=$(sed -n 's/^CHANNEL=\(.*\)$/\1/p' "$channel_file" | head -1)
@@ -100,7 +104,11 @@ get_install_channel() {
}
get_install_commit() {
local channel_file="$SCRIPT_DIR/install_channel"
# Try user config dir first (matches install.sh behavior), fallback to SCRIPT_DIR
local channel_file="${MOLE_CONFIG_DIR:-$HOME/.config/mole}/install_channel"
if [[ ! -f "$channel_file" ]]; then
channel_file="$SCRIPT_DIR/install_channel"
fi
if [[ -f "$channel_file" ]]; then
sed -n 's/^COMMIT_HASH=\(.*\)$/\1/p' "$channel_file" | head -1
fi