corpnewt / ProperTree

Cross platform GUI plist editor written in python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shell script issue

calorique opened this issue · comments

In the ProperTree.command script file:
curl "$url" -o "$tempdir/python.pkg"
if [ "$?" != "0" ]; then
echo
echo " - Failed to install python!"
echo
exit $?
fi
The exit code( $?) of curl will be replaced by echo, it always be zerio. If it needs the exit code, use a variable to store, like this:
curl "$url" -o "$tempdir/python.pkg"
RET=$?
if [ "${RET}" != "0" ]; then
echo
echo " - Failed to install python!"
echo
exit ${RET}
fi
or more simple :
curl "$url" -o "$tempdir/python.pkg" || {
echo
echo " - Failed to install python!"
echo
}
because that the error was handled already and the exit code was dropped at last.