Skip to content

Commit

Permalink
fix regression in outfunc handling for app scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Phantop committed Jul 5, 2024
1 parent a6a30c5 commit 4f6c908
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion appdwarf
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions apps/getapp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion apps/mkwine
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ apprun() {
}
if [ "$PREFIX" ]; then
WINEPREFIX="$DIR/prefix" "$DIR/bin/wine" cmd /c exit
appb
appa
fi

appmk

0 comments on commit 4f6c908

Please sign in to comment.