From 4f6c908ee9484991f926ab5f4662990a4050f41d Mon Sep 17 00:00:00 2001 From: Phantop Date: Fri, 5 Jul 2024 08:19:40 -0400 Subject: [PATCH] fix regression in outfunc handling for app scripts --- appdwarf | 5 ++++- apps/getapp | 1 + apps/mkwine | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/appdwarf b/appdwarf index 2f56993..6cdd5c1 100755 --- a/appdwarf +++ b/appdwarf @@ -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 diff --git a/apps/getapp b/apps/getapp index f25b911..7b2637f 100755 --- a/apps/getapp +++ b/apps/getapp @@ -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" diff --git a/apps/mkwine b/apps/mkwine index 4b52cab..2670a08 100755 --- a/apps/mkwine +++ b/apps/mkwine @@ -34,7 +34,7 @@ apprun() { } if [ "$PREFIX" ]; then WINEPREFIX="$DIR/prefix" "$DIR/bin/wine" cmd /c exit - appb + appa fi appmk