mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
refactor: move utils.sh loading to script initialization because this is an installer dependency
This commit is contained in:
@@ -40,6 +40,7 @@ BASE_DIR="/usr/local/share/proxmenux"
|
|||||||
CONFIG_FILE="$BASE_DIR/config.json"
|
CONFIG_FILE="$BASE_DIR/config.json"
|
||||||
CACHE_FILE="$BASE_DIR/cache.json"
|
CACHE_FILE="$BASE_DIR/cache.json"
|
||||||
UTILS_FILE="$BASE_DIR/utils.sh"
|
UTILS_FILE="$BASE_DIR/utils.sh"
|
||||||
|
UTILS_URL="https://github.com/MacRimi/ProxMenux/raw/refs/heads/main/scripts/utils.sh"
|
||||||
LOCAL_VERSION_FILE="$BASE_DIR/version.txt"
|
LOCAL_VERSION_FILE="$BASE_DIR/version.txt"
|
||||||
MENU_SCRIPT="menu"
|
MENU_SCRIPT="menu"
|
||||||
VENV_PATH="/opt/googletrans-env"
|
VENV_PATH="/opt/googletrans-env"
|
||||||
@@ -54,6 +55,15 @@ MONITOR_PORT=8008
|
|||||||
REPO_URL="https://github.com/c78-contrib/ProxMenuxOffline.git"
|
REPO_URL="https://github.com/c78-contrib/ProxMenuxOffline.git"
|
||||||
TEMP_DIR="/tmp/proxmenux-install-$$"
|
TEMP_DIR="/tmp/proxmenux-install-$$"
|
||||||
|
|
||||||
|
# Load utils.sh from local repository
|
||||||
|
if [[ -f "$UTILS_URL" ]]; then
|
||||||
|
source "$UTILS_URL"
|
||||||
|
else
|
||||||
|
msg_error "Failed to load utils dependencies. Please report this issue."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
cleanup_corrupted_files() {
|
cleanup_corrupted_files() {
|
||||||
if [ -f "$CONFIG_FILE" ] && ! jq empty "$CONFIG_FILE" >/dev/null 2>&1; then
|
if [ -f "$CONFIG_FILE" ] && ! jq empty "$CONFIG_FILE" >/dev/null 2>&1; then
|
||||||
echo "Cleaning up corrupted configuration file..."
|
echo "Cleaning up corrupted configuration file..."
|
||||||
@@ -481,14 +491,6 @@ install_normal_version() {
|
|||||||
# Change to temporary directory
|
# Change to temporary directory
|
||||||
cd "$TEMP_DIR"
|
cd "$TEMP_DIR"
|
||||||
|
|
||||||
# Load utils.sh from local repository
|
|
||||||
if [[ -f "./scripts/utils.sh" ]]; then
|
|
||||||
source "./scripts/utils.sh"
|
|
||||||
else
|
|
||||||
msg_error "Failed to load utils.sh from local repository. Please report this issue."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
((current_step++))
|
((current_step++))
|
||||||
|
|||||||
Reference in New Issue
Block a user