From ac86389aaff6d8d35354430ef1c0cffc9b6ab006 Mon Sep 17 00:00:00 2001 From: q3aql Date: Tue, 16 Jul 2024 05:00:58 +0200 Subject: [PATCH] Compatible with POSIX Standard --- packelf-appimage.sh | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/packelf-appimage.sh b/packelf-appimage.sh index 28c3adc..b2844c7 100755 --- a/packelf-appimage.sh +++ b/packelf-appimage.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env sh # Author: q3aql@duck.com # Pack elf binary and it's dependencies into standalone executable using appimagetool @@ -49,18 +49,7 @@ create_desktop_file() { echo "Terminal=false" >> ${desktop_file_path}/${desktop_file_name}.desktop echo "Categories=System;" >> ${desktop_file_path}/${desktop_file_name}.desktop echo "StartupWMClass=mpv" >> ${desktop_file_path}/${desktop_file_name}.desktop - # Create icon for desktop file - echo '' > ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo ' ' >> ${desktop_file_path}/${desktop_file_name}.svg - echo '' >> ${desktop_file_path}/${desktop_file_name}.svg + echo 'pngfile' > ${desktop_file_path}/${desktop_file_name}.png } # Check if file exist @@ -91,8 +80,8 @@ else temp_dir=$(mktemp -d) echo "Creating static binary ${2} from ${1}" cp -L ${1} ${temp_dir}/ + echo "Linking libraries ${libraries}" for libraries in ${libs} ; do - echo "Linking library ${libraries}" cp -L ${libraries} ${temp_dir}/ done echo "Creating executable linker" @@ -102,7 +91,7 @@ else create_desktop_file "${temp_dir}" "${program}" chmod 777 -R "${temp_dir}" echo "Building static binary in ${2}" - appimagetool ${temp_dir} "${2}" &> /dev/null + appimagetool ${temp_dir} "${2}" > /dev/null 2> /dev/null rm -rf ${temp_dir} if [ -f "${2}" ] ; then echo "Created successfully"