fix regression in outfunc handling for app scripts

This commit is contained in:
Phantop 2024-07-05 08:19:40 -04:00
parent a6a30c56ad
commit 4f6c908ee9
3 changed files with 6 additions and 2 deletions

View file

@ -57,7 +57,7 @@ header() {
outfunc() {
echo '#!/bin/sh'
echo 'set -e' # running outfunc with no input just prints these two lines
sed -n "/^$1() {$/,/^}$/s/^ *//p" "$0" | tail -n+2 | head -n-1
sed -n "/^$1() {$/,/^}$/s/^ *//p" "$script" | tail -n+2 | head -n-1
}
unappimage() {
@ -92,11 +92,14 @@ zzexe_header() {
if [ "$SOURCE" ]; then
unset SOURCE
script="$(which appdwarf)"
trap 'rm -rf "$DIR"' 0 1 2 3 6 14 15 EXIT
APP=$(basename "$0" | sed 's/^mk//')
DIR=/tmp/appdwarf/$APP
mkdir -p "$DIR"
return
else
script="$0"
fi
case "$1" in

View file

@ -3,4 +3,5 @@ set -e # exit on failure
IFS=$(printf '\n\t') # smarter ifs
cd "$(dirname "$(realpath "$0")")/bin"
rm -f "$(echo "$1" | sed 's/arch-//')"
appdwarf -g "$1"

View file

@ -34,7 +34,7 @@ apprun() {
}
if [ "$PREFIX" ]; then
WINEPREFIX="$DIR/prefix" "$DIR/bin/wine" cmd /c exit
appb
appa
fi
appmk