levix-bot 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/deploy/install.sh +15 -6
  2. package/package.json +1 -1
package/deploy/install.sh CHANGED
@@ -66,21 +66,30 @@ node_major() {
66
66
  esac
67
67
  }
68
68
 
69
+ # Read distro metadata in a subshell. /etc/os-release commonly defines VERSION,
70
+ # which must never overwrite Levix's own release VERSION in the parent shell.
71
+ read_os_id() (
72
+ local os_release="$1"
73
+ [ -r "$os_release" ] || return 1
74
+ # shellcheck disable=SC1090
75
+ . "$os_release"
76
+ printf '%s\n' "${ID:-}"
77
+ )
78
+
69
79
  install_node24() {
70
- [ -r /etc/os-release ] ||
80
+ local distro_id
81
+ distro_id="$(read_os_id /etc/os-release)" ||
71
82
  die "Node ${MIN_NODE_MAJOR}+ is required. Automatic Node installation is supported on Debian and Ubuntu only."
72
83
 
73
- # shellcheck disable=SC1091
74
- . /etc/os-release
75
- case "${ID:-}" in
84
+ case "$distro_id" in
76
85
  debian|ubuntu) ;;
77
86
  *)
78
- die "Node ${MIN_NODE_MAJOR}+ is required. Automatic Node installation is supported on Debian and Ubuntu only (found ${ID:-unknown}). Install Node ${MIN_NODE_MAJOR}+ and run this installer again."
87
+ die "Node ${MIN_NODE_MAJOR}+ is required. Automatic Node installation is supported on Debian and Ubuntu only (found ${distro_id:-unknown}). Install Node ${MIN_NODE_MAJOR}+ and run this installer again."
79
88
  ;;
80
89
  esac
81
90
 
82
91
  command -v apt-get >/dev/null 2>&1 ||
83
- die "This looks like ${ID}, but apt-get is unavailable. Install Node ${MIN_NODE_MAJOR}+ and run this installer again."
92
+ die "This looks like ${distro_id}, but apt-get is unavailable. Install Node ${MIN_NODE_MAJOR}+ and run this installer again."
84
93
 
85
94
  say "Installing Node ${MIN_NODE_MAJOR} from NodeSource…"
86
95
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "levix-bot",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "A self-hosted personal WhatsApp bot with an AI agent, group moderation and a web control panel.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {