Skip to content

Commit

Permalink
Merge pull request #200 from gerlero/scripts
Browse files Browse the repository at this point in the history
Update shell session script
  • Loading branch information
gerlero authored Oct 6, 2023
2 parents 4ab3617 + 70a92a0 commit ab64291
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Contents/Resources/etc/openfoam
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ APP_NAME="{{APP_NAME}}"

APP_BUNDLE="${0:A:h:h:h:h}"

echo "---------------------------------------------------------------------------" 1>&2
echo " | " 1>&2
echo " ( ) | °°° $APP_NAME.app °°° " 1>&2
echo " ( ) ( ) | " 1>&2
echo " ( ) | Native OpenFOAM for macOS " 1>&2
echo " | {{APP_HOMEPAGE}} " 1>&2
echo "---------------------------------------------------------------------------" 1>&2
if [ $# -eq 0 ]; then
echo "---------------------------------------------------------------------------" 1>&2
echo " | " 1>&2
echo " ( ) | °°° $APP_NAME.app °°° " 1>&2
echo " ( ) ( ) | " 1>&2
echo " ( ) | Native OpenFOAM for macOS " 1>&2
echo " | {{APP_HOMEPAGE}} " 1>&2
echo "---------------------------------------------------------------------------" 1>&2

"$APP_BUNDLE/Contents/Resources/volume" mount 1>&2
"$APP_BUNDLE/Contents/Resources/volume" mount 1>&2

echo "Activating the OpenFOAM environment..." 1>&2
else
"$APP_BUNDLE/Contents/Resources/volume" -quiet mount 1>&2
fi

VOLUME=$("$APP_BUNDLE/Contents/Resources/volume" -show-prefix)

# Keep the volume directory open in this process (prevents accidental ejection)
exec {fd}<"$VOLUME"

echo "Activating the OpenFOAM environment..." 1>&2
PATH="$VOLUME/usr/opt/bash/bin${PATH+:$PATH}" exec bash "$VOLUME/etc/openfoam" "$@"

0 comments on commit ab64291

Please sign in to comment.