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

feat: show nightly channel in version output

Refs #517
This commit is contained in:
tw93
2026-03-02 10:54:44 +08:00
parent 0a8f92cf83
commit 27a2cc5927
3 changed files with 83 additions and 0 deletions

18
mole
View File

@@ -87,6 +87,18 @@ is_homebrew_install() {
return 1
}
get_install_channel() {
local channel_file="$SCRIPT_DIR/install_channel"
local channel="stable"
if [[ -f "$channel_file" ]]; then
channel=$(sed -n 's/^CHANNEL=\(.*\)$/\1/p' "$channel_file" | head -1)
fi
case "$channel" in
nightly | dev | stable) printf '%s\n' "$channel" ;;
*) printf 'stable\n' ;;
esac
}
# Background update notice
check_for_updates() {
local msg_cache="$HOME/.cache/mole/update_message"
@@ -205,7 +217,13 @@ show_version() {
install_method="Homebrew"
fi
local channel
channel=$(get_install_channel)
printf '\nMole version %s\n' "$VERSION"
if [[ "$channel" == "nightly" ]]; then
printf 'Channel: Nightly\n'
fi
printf 'macOS: %s\n' "$os_ver"
printf 'Architecture: %s\n' "$arch"
printf 'Kernel: %s\n' "$kernel"