Skip to content

Commit 3bcbcc7

Browse files
authored
fix: add runscript to test.def to source OpenFOAM automatically (#7)
Fixes #6 Add a `%runscript` section to `projects/test.def` to source OpenFOAM automatically. * Add a `%runscript` section to `projects/test.def` to source OpenFOAM automatically. * Use the `%runscript` section from `basic/com-openfoam.def` as a reference.
1 parent 6ebfcba commit 3bcbcc7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

projects/test.def

+8
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,13 @@ From: {{ CONTAINERS_DIR }}/basic/{{ BASE_CONTAINER }}.sif
4444
} end' /apps.json > /tmp/apps.json
4545
mv /tmp/apps.json /apps.json
4646

47+
%runscript
48+
/bin/bash -c 'cd /usr/lib/openfoam/openfoam{{ FRAMEWORK_VERSION }} && source etc/bashrc && mkdir -p $FOAM_USER_LIBBIN && mkdir -p $FOAM_USER_APPBIN'
49+
if [ $# -eq 0 ]; then
50+
/usr/bin/openfoam{{ FRAMEWORK_VERSION }}
51+
else
52+
/usr/bin/openfoam{{ FRAMEWORK_VERSION }} $@
53+
fi
54+
4755
%labels
4856
Description Test applications for ESI OpenFOAM

0 commit comments

Comments
 (0)