Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell script issue #127

Open
calorique opened this issue Apr 13, 2022 · 0 comments
Open

Shell script issue #127

calorique opened this issue Apr 13, 2022 · 0 comments

Comments

@calorique
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant