Add error handling in CPT scripts
This commit is contained in:
parent
593b78a9cc
commit
558ea7d719
@ -21,6 +21,7 @@
|
||||
|
||||
# Uncomment the following line to trace the execution of the shell commands
|
||||
# set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
# TODO: Change workdir to a suitable path on your system (or Electric Commander)
|
||||
workdir=~/ec/build
|
||||
@ -34,6 +35,9 @@ source ${HOST_CLING_SRC_DIR}/indep.sh
|
||||
source ${HOST_CLING_SRC_DIR}/debian/debianize.sh
|
||||
source ${HOST_CLING_SRC_DIR}/windows/windows_dep.sh
|
||||
|
||||
# Trap exceptions, call function "cleanup" and exit
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
function usage {
|
||||
cat <<- EOT
|
||||
Cling Packaging Tool
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
# Uncomment the following line to trace the execution of the shell commands
|
||||
# set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
function tarball_deb {
|
||||
box_draw "Compressing compiled binaries to produce a bzip2 tarball"
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
# Uncomment the following line to trace the execution of the shell commands
|
||||
# set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
function platform_init {
|
||||
OS=$(uname -o)
|
||||
@ -295,12 +296,16 @@ function cleanup {
|
||||
box_draw "Clean up"
|
||||
echo "Remove directory: ${workdir}/builddir"
|
||||
rm -Rf ${workdir}/builddir
|
||||
echo "Remove directory: ${prefix}"
|
||||
rm -Rf ${prefix}
|
||||
|
||||
if [ -d "${prefix}" ]; then
|
||||
echo "Remove directory: ${prefix}"
|
||||
rm -Rf ${prefix}
|
||||
fi
|
||||
|
||||
echo "Remove directory: ${TMP_PREFIX}"
|
||||
rm -Rf ${TMP_PREFIX}
|
||||
|
||||
if [ -f ${workdir}/cling.nsi ]; then
|
||||
if [ -f "${workdir}/cling.nsi" ]; then
|
||||
echo "Remove file: cling.nsi"
|
||||
rm -Rf ${workdir}/cling.nsi
|
||||
fi
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
# Uncomment the following line to trace the execution of the shell commands
|
||||
# set -o xtrace
|
||||
set -o errexit
|
||||
|
||||
function check_cygwin {
|
||||
# Check for Cygwin
|
||||
|
Loading…
x
Reference in New Issue
Block a user