Skip to content

Commit

Permalink
Ensure this script shows a notification on Oolite failure. A matching…
Browse files Browse the repository at this point in the history
… commit will be on branch doNotBlockOnError in the oolite-linux-dependencies repository (#432)
  • Loading branch information
HiranChaudhuri committed Jul 12, 2023
1 parent 9be1f6a commit 34be270
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions installers/posix/setup.body
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# the "which <filename>" command uses stderr to report a file not found or other warnings
# 2018-07-02: Add command line arguments support.
# First argument added is "--systemwide-path Directory"
# 2023-07-10: Add interactive parts from oolite.src to startup script based on FreeDesktop tools
#


Expand Down Expand Up @@ -211,9 +212,32 @@ mv ${INSTALLER_REPOS}/release.txt .

# Generate startup scripts
cd ${STARTUP_SCRIPTS_PATH}
echo "#!/bin/sh" > oolite${TRUNK}
echo "${OOLITEAPP_PATH}/oolite-wrapper \$@" >> oolite${TRUNK}
echo "exit \$?" >> oolite${TRUNK}

cat << EOF_STARTUP_SCRIPT > oolite${TRUNK}
#!/bin/sh

# show readme on first launch
if [ ! -f \$HOME/.Oolite/.oolite${TRUNK}-run ]
then
mkdir -p $HOME/.Oolite/
touch \$HOME/.Oolite/.oolite${TRUNK}-run
xdg-open file://${OOLITE_ROOT}/doc/README-PREAMBLE.TXT
xdg-open file://${OOLITE_ROOT}/doc/README.TXT
fi

# launch oolite
${OOLITEAPP_PATH}/oolite-wrapper $@
RC=\$?

# show message in case of error
if [ "\${RC}" != "0" ]
then
notify-send --urgency=critical --icon ${OOLITE_ROOT}/oolite.app/Resources/Textures/oolite-logo1.png "Oolite" "Oolite died in a singularity with exit code \${RC}. For troubleshooting check console and log output."
fi

exit \${RC}
EOF_STARTUP_SCRIPT

chmod +x oolite${TRUNK}
echo "#!/bin/sh" > oolite${TRUNK}-update
echo "${OOLITEAPP_PATH}/oolite-update \$@" >> oolite${TRUNK}-update
Expand Down

0 comments on commit 34be270

Please sign in to comment.