Skip to content

Commit

Permalink
pic-configure: cmakeFlags return code
Browse files Browse the repository at this point in the history
Cleanly abort if `cmakeFlags` exist but could not be
successfully executed.

This can e.g. happen due to
- a wrongly selected case
- a newly created file with missing +x rights
  • Loading branch information
ax3l committed Dec 11, 2017
1 parent dbdaa23 commit 7c136f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pic-configure
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ if [ ! -d "$extension_param" ] ; then
fi
#check for cmakeFlags file (interprete with sh)
if [ -f "$extension_param/cmakeFlags" ] ; then
cmake_flags=`$extension_param/cmakeFlags $cmakeFlagsNr`
cmake_flags=$($extension_param/cmakeFlags $cmakeFlagsNr)
if [ $? -ne 0 ] ; then
echo "ERROR: Executing '$extension_param/cmakeFlags' failed!" >&2
echo " Is the file executable? (chmod u+x cmakeFlags)" >&2
exit 2
fi
fi

#set default install path if no path is set by paramater
Expand Down

0 comments on commit 7c136f6

Please sign in to comment.