Compare commits

..

4 Commits

Author SHA1 Message Date
MickLesk fb7ceab989 fix(tools): only use corepack where scripts actually need it
Remove bulk corepack prefix from global pnpm/yarn installs and limit corepack enable in setup_nodejs to explicit corepack modules or Node 25+.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 22:05:32 +02:00
MickLesk 1363e5eab8 fix(ct): ensure corepack is enabled before yarn/pnpm updates
Run setup_nodejs with corepack in update scripts that use bare package manager commands after corepack prepare.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 22:00:32 +02:00
MickLesk 16ea8eb8f6 refactor(install): use setup_nodejs corepack via NODE_MODULE
Remove redundant corepack enable calls from install scripts and rely on centralized setup_nodejs handling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 21:56:29 +02:00
MickLesk 1f01f32853 refactor(tools): centralize Node.js corepack and npm handling in setup_nodejs
Move corepack install/enable into setup_nodejs and update CT scripts to use NODE_MODULE instead of manual corepack calls.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 21:55:20 +02:00
2 changed files with 12 additions and 38 deletions
-4
View File
@@ -496,10 +496,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- [arm64] port scripts titled between papra and qbittorrent to support arm64 [@asylumexp](https://github.com/asylumexp) ([#15258](https://github.com/community-scripts/ProxmoxVE/pull/15258))
- [arm64] Port scripts between mediamtx-nocodb to support arm64 [@asylumexp](https://github.com/asylumexp) ([#15254](https://github.com/community-scripts/ProxmoxVE/pull/15254))
- #### 🔧 Refactor
- tools.func: centralize Node.js corepack and npm handling in `setup_nodejs()` [@MickLesk](https://github.com/MickLesk) ([#15268](https://github.com/community-scripts/ProxmoxVE/pull/15268))
## 2026-06-20
### 🆕 New Scripts
+12 -34
View File
@@ -282,7 +282,7 @@ get_cached_version() {
cat "/var/cache/app-versions/${app}_version.txt"
return 0
fi
return 1
return 0
}
# ------------------------------------------------------------------------------
@@ -462,10 +462,10 @@ install_packages_with_retry() {
fi
fi
done
# If some packages installed, consider partial success
if [[ ${#failed[@]} -lt ${#packages[@]} ]]; then
if [[ ${#failed[@]} -gt 0 ]]; then
msg_error "Partial install — failed packages: ${failed[*]}"
return 100
msg_warn "Partially installed. Failed packages: ${failed[*]}"
fi
return 0
fi
@@ -1122,34 +1122,11 @@ get_system_arch() {
# ------------------------------------------------------------------------------
# Create temporary directory with automatic cleanup
# Appends to a shared list so existing EXIT traps are preserved.
# ------------------------------------------------------------------------------
_tools_temp_dirs=()
_tools_cleanup_temp_dirs() {
local d
for d in "${_tools_temp_dirs[@]}"; do
rm -rf "$d" 2>/dev/null || true
done
}
_tools_register_temp_cleanup() {
[[ "${_TOOLS_TEMP_TRAP_SET:-}" == "1" ]] && return 0
_TOOLS_TEMP_TRAP_SET=1
local existing
existing=$(trap -p EXIT 2>/dev/null | sed -n "s/^trap -- '\\(.*\\)' EXIT/\1/p" || true)
if [[ -n "$existing" && "$existing" != "_tools_cleanup_temp_dirs" ]]; then
trap "_tools_cleanup_temp_dirs; ${existing}" EXIT ERR INT TERM
else
trap _tools_cleanup_temp_dirs EXIT ERR INT TERM
fi
}
create_temp_dir() {
local tmp_dir
tmp_dir=$(mktemp -d) || return 1
_tools_temp_dirs+=("$tmp_dir")
_tools_register_temp_cleanup
local tmp_dir=$(mktemp -d)
# Set trap to cleanup on EXIT, ERR, INT, TERM
trap "rm -rf '$tmp_dir'" EXIT ERR INT TERM
echo "$tmp_dir"
}
@@ -2072,11 +2049,9 @@ setup_deb822_repo() {
[[ -n "$enabled" ]] && echo "Enabled: $enabled"
} >/etc/apt/sources.list.d/${name}.sources
if ! $STD apt update; then
msg_error "apt update failed after adding repository: ${name}"
msg_error "Hint: Verify suite '${suite}' and URI '${repo_url}' are valid for this distribution."
return 100
fi
$STD apt update || {
msg_warn "apt update failed after adding repository: ${name}"
}
}
# ------------------------------------------------------------------------------
@@ -8584,10 +8559,13 @@ setup_uv() {
local UV_BIN="/usr/local/bin/uv"
local UVX_BIN="/usr/local/bin/uvx"
local TMP_DIR=$(mktemp -d)
local CACHED_VERSION
# trap for TMP Cleanup
trap "rm -rf '$TMP_DIR'" EXIT
CACHED_VERSION=$(get_cached_version "uv")
# Architecture Detection
local ARCH=$(uname -m)
local OS_TYPE=""