appimage updates
This commit is contained in:
@@ -93,6 +93,25 @@ needs_update() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Install desktop file if specified
|
||||
install_desktop() {
|
||||
local desktop="$1"
|
||||
|
||||
if [ -z "$desktop" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -f "$desktop" ]; then
|
||||
echo " Warning: desktop file $desktop not found, skipping."
|
||||
return
|
||||
fi
|
||||
|
||||
echo " Installing desktop file..."
|
||||
mkdir -p "$HOME/.local/share/applications"
|
||||
cp "$desktop" "$HOME/.local/share/applications/"
|
||||
echo " Desktop file installed."
|
||||
}
|
||||
|
||||
# Fetch source via git or wget
|
||||
fetch_source() {
|
||||
local app="$1"
|
||||
@@ -183,10 +202,19 @@ process_app() {
|
||||
local install_path="$4"
|
||||
local steps="$5"
|
||||
local version="$6"
|
||||
local desktop="$7"
|
||||
|
||||
echo ""
|
||||
echo "=== $app ==="
|
||||
|
||||
# Check if already installed
|
||||
if command -v "$app" &> /dev/null || [ -f "$install_path" ]; then
|
||||
if [ -z "$version" ]; then
|
||||
echo " $app is already installed, skipping."
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo " Warning: no version specified in compile.conf for $app."
|
||||
read -rp " Compile and install $app anyway? [y/N] " response
|
||||
@@ -200,23 +228,24 @@ process_app() {
|
||||
|
||||
fetch_source "$app" "$git_url" "$wget_url"
|
||||
run_steps "$app" "$steps"
|
||||
install_desktop "$desktop"
|
||||
save_installed_version "$app" "$version"
|
||||
echo " $app $version installed successfully."
|
||||
}
|
||||
|
||||
# Parse compile.conf and process each app
|
||||
process_conf() {
|
||||
local app="" git_url="" wget_url="" install_path="" steps="" version=""
|
||||
local app="" git_url="" wget_url="" install_path="" steps="" version="" desktop=""
|
||||
|
||||
while IFS= read -r line || [ -n "$line" ]; do
|
||||
[[ -z "$line" || "$line" == \#* ]] && continue
|
||||
|
||||
if [[ "$line" =~ ^\[(.+)\]$ ]]; then
|
||||
if [ -n "$app" ]; then
|
||||
process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version"
|
||||
process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop"
|
||||
fi
|
||||
app="${BASH_REMATCH[1]}"
|
||||
git_url="" wget_url="" install_path="" steps="" version=""
|
||||
git_url="" wget_url="" install_path="" steps="" version="" desktop=""
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -229,13 +258,14 @@ process_conf() {
|
||||
install) install_path="$value" ;;
|
||||
steps) steps="$value" ;;
|
||||
version) version="$value" ;;
|
||||
desktop) desktop="$value" ;;
|
||||
esac
|
||||
|
||||
done < "$CONF_FILE"
|
||||
|
||||
# Process the last app in the file
|
||||
if [ -n "$app" ]; then
|
||||
process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version"
|
||||
process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user