2
0

Better exit status preservation on error.

This commit is contained in:
Maarten Billemont 2018-06-05 14:12:10 -04:00
parent 02aed778bc
commit 7a97a0b0c8

View File

@ -98,26 +98,18 @@ if [[ "$(latest "$ios_icon"/*)" -nt "$appiconset/Contents.json" ]] ||
source=$ios_icon/$filename source=$ios_icon/$filename
if [[ ! -e $source ]]; then if [[ ! -e $source ]]; then
source=$mac_icon/$filename source=$mac_icon/$filename
if [[ ! -e $source ]]; then [[ -e $source ]] || ftl 'No icon for: %s' "$filename"
err 'No icon for: %s' "$filename"
exit 1
fi
fi fi
if imageProps=$(copyImage "$source" "$appiconset/$filename"); then imageProps=$(copyImage "$source" "$appiconset/$filename")
printf '%s{"size":"%dx%d","filename":"%s","scale":"%sx"' \ printf '%s{"size":"%dx%d","filename":"%s","scale":"%sx"' \
"$comma" "$pt" "$pt" "$filename" "$scale" "$comma" "$pt" "$pt" "$filename" "$scale"
[[ $idiom ]] && printf ',"idiom":"%s"' "$idiom" [[ $idiom ]] && printf ',"idiom":"%s"' "$idiom"
[[ $os ]] && printf ',"minimum-system-version":"%s"' "$os" [[ $os ]] && printf ',"minimum-system-version":"%s"' "$os"
[[ $imageProps ]] && printf '%s' "$imageProps" [[ $imageProps ]] && printf '%s' "$imageProps"
printf '}' printf '}'
comma=,
else
rm "$appiconset/Contents.json"
exit
fi
comma=,
done done
printf '],"info":{"version":1,"author":"genassets"},"properties":{"pre-rendered":true}}\n' printf '],"info":{"version":1,"author":"genassets"},"properties":{"pre-rendered":true}}\n'
} > "$appiconset/Contents.json" } > "$appiconset/Contents.json"
@ -138,20 +130,16 @@ if [[ "$(latest "$ios_launch"/*)" -nt "$launchimage/Contents.json" ]]; then
esac esac
filename="Default${os:+-$os}${subtype:+-$subtype}${scale:+@${scale}x}${idiom:+~$idiom}.png" filename="Default${os:+-$os}${subtype:+-$subtype}${scale:+@${scale}x}${idiom:+~$idiom}.png"
if imageProps=$(copyImage "$ios_launch/$name${scale:+@${scale}x}.png" "$launchimage/$filename"); then imageProps=$(copyImage "$ios_launch/$name${scale:+@${scale}x}.png" "$launchimage/$filename"); then
printf '%s{"extent":"full-screen","filename":"%s","orientation":"portrait","scale":"%sx"' \ printf '%s{"extent":"full-screen","filename":"%s","orientation":"portrait","scale":"%sx"' \
"$comma" "$filename" "${scale:-1}" "$comma" "$filename" "${scale:-1}"
[[ $idiom ]] && printf ',"idiom":"%s"' "$idiom" [[ $idiom ]] && printf ',"idiom":"%s"' "$idiom"
[[ $os ]] && printf ',"minimum-system-version":"%s"' "$os" [[ $os ]] && printf ',"minimum-system-version":"%s"' "$os"
[[ $subtype ]] && printf ',"subtype":"%s"' "$subtype" [[ $subtype ]] && printf ',"subtype":"%s"' "$subtype"
[[ $imageProps ]] && printf '%s' "$imageProps" [[ $imageProps ]] && printf '%s' "$imageProps"
printf '}' printf '}'
comma=, comma=,
else
rm "$launchimage/Contents.json"
exit
fi
done done
printf '],"info":{"version":1,"author":"genassets"}}\n' printf '],"info":{"version":1,"author":"genassets"}}\n'
} > "$launchimage/Contents.json" } > "$launchimage/Contents.json"