Fix Linux Mint codename

This commit is contained in:
2024-09-03 20:30:08 -04:00
parent 44988082ef
commit 68bc8ba6b9

View File

@@ -1606,30 +1606,6 @@ update_self() {
echo "Checking for installJRMC update" echo "Checking for installJRMC update"
# Function to extract and normalize version from a script
extract_version() {
local version_line
version_line=$(grep -m 1 'SCRIPT_VERSION=' "$1")
if [[ -z "$version_line" ]]; then
echo "Error: SCRIPT_VERSION not found in $1" >&2
return 1
fi
version_line=${version_line#*=} # Remove everything before and including '='
version_line=${version_line#\"} # Remove leading '"'
version_line=${version_line%\"} # Remove trailing '"'
version_line=${version_line%-dev} # Remove '-dev' suffix if present
echo "$version_line"
}
echo HERE
# Check if we're in a git directory and if it's the installJRMC repository # Check if we're in a git directory and if it's the installJRMC repository
if git -C "$SCRIPT_DIR" rev-parse --is-inside-work-tree &>/dev/null \ if git -C "$SCRIPT_DIR" rev-parse --is-inside-work-tree &>/dev/null \
&& [[ "$(git -C "$SCRIPT_DIR" config --get remote.origin.url)" == *"bryan/installJRMC"* ]]; then && [[ "$(git -C "$SCRIPT_DIR" config --get remote.origin.url)" == *"bryan/installJRMC"* ]]; then
@@ -1667,11 +1643,20 @@ update_self() {
declare -p declare -p
# Compare versions and update if necessary # Extract and normalize versions inline
local local_version local local_version
local_version=$(extract_version "$SCRIPT_PATH") local_version=$(grep -m 1 'SCRIPT_VERSION=' "$SCRIPT_PATH")
local_version=${local_version#*=}
local_version=${local_version#\"}
local_version=${local_version%\"}
local_version=${local_version%-dev}
local remote_version local remote_version
remote_version=$(extract_version "$tmp") remote_version=$(grep -m 1 'SCRIPT_VERSION=' "$tmp")
remote_version=${remote_version#*=}
remote_version=${remote_version#\"}
remote_version=${remote_version%\"}
remote_version=${remote_version%-dev}
echo HERE4 echo HERE4
@@ -1692,6 +1677,7 @@ update_self() {
} }
main() { main() {
debug "Running: ${FUNCNAME[0]} $*" debug "Running: ${FUNCNAME[0]} $*"