Commit 7800349a authored by Roman Haefeli's avatar Roman Haefeli
Browse files

check for failure after every subshell

parent e4808867
......@@ -41,6 +41,8 @@ function fail {
# do stuff
(
cd "$(dirname "$0")"
(
mkdir -p "${work_dir}"
cd "${work_dir}"
......@@ -54,32 +56,39 @@ function fail {
for url in ${ext_urls[@]}
do
echo "downloading $url"
curl -o file "${url}" || fail
curl -q -o file "${url}" || fail
if file file | grep ' Zip archive data' > /dev/null
then
unzip file || fail
fi
if file file | grep 'gzip compressed data' > /dev/null
then
tar xvf file || fail
tar xf file || fail
fi
rm file || fail
done
)
) || fail
# install netpd
(
cd ${app_bundle_name}/Contents/Resources
curl -o file "${netpd_bundle_url}" || fail
curl -q -o file "${netpd_bundle_url}" || fail
unzip file && rm file || fail
)
) || fail
)
) || fail
# apply patch to load netpd at start
patch ${work_dir}/${app_bundle_name}/Contents/Resources/tcl/pd-gui.tcl < files/pd-gui.tcl.patch || fail
cp files/netpd.icns ${work_dir}/${app_bundle_name}/Contents/Resources/ || fail
sed -f <(echo "${info_plist_replacements}") files/Info.plist > ${work_dir}/${app_bundle_name}/Contents/Info.plist
# apply patch to load netpd at start
patch ${work_dir}/${app_bundle_name}/Contents/Resources/tcl/pd-gui.tcl < files/pd-gui.tcl.patch || fail
cp files/netpd.icns ${work_dir}/${app_bundle_name}/Contents/Resources/ || fail
sed -f <(echo "${info_plist_replacements}") files/Info.plist > ${work_dir}/${app_bundle_name}/Contents/Info.plist || fail
echo "Done!"
# create archive
(
cd "${work_dir}"
tar cf "../${app_name}-${app_version}.tar.gz" "${app_bundle_name}" || fail
) || fail
rm -r "${work_dir}"
echo "Done!"
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment