@@ -31,27 +31,31 @@ From: containers/basic/{{ BASE_CONTAINER }}.sif
31
31
git clone --single-branch --branch {{ FRAMEWORK_GIT_REF }} --depth 1 \
32
32
git://git.code.sf.net/p/foam-extend/foam-extend-{{ FRAMEWORK_VERSION }} \
33
33
/opt/foam/foam-extend-{{ FRAMEWORK_VERSION }}
34
- sed -i 's|^foamInstall.*|foamInstall=/opt/foam|' /opt/foam/foam-extend-{{ FRAMEWORK_VERSION }}/etc/bashrc
34
+ export FOAM_BASHRC="/opt/foam/foam-extend-{{ FRAMEWORK_VERSION }}/etc/bashrc"
35
+ sed -i '/_foamSource.*aliases.sh/d' $FOAM_BASHRC
36
+ sed -i '/while \[ \$# -gt 0 \]/,/^done$/d' $FOAM_BASHRC
37
+ sed -i 's|^foamInstall.*|foamInstall=/opt/foam|' $FOAM_BASHRC
35
38
nProcs=$(nproc)
36
39
/bin/bash -c "cd /opt/foam/foam-extend-{{ FRAMEWORK_VERSION }} && source etc/bashrc && ./Allwmake.firstInstall -j $nProcs"
37
40
rm -rf /opt/foam/foam-extend-{{ FRAMEWORK_VERSION }}/tutorials/*
38
41
FRAMEWORK_COMMIT_HASH=$(git -C /opt/foam/foam-extend-{{ FRAMEWORK_VERSION }} rev-parse HEAD)
39
42
jq --arg app openfoam --arg commit $FRAMEWORK_COMMIT_HASH \
40
43
--arg branch {{ FRAMEWORK_GIT_REF }} \
44
+ --arg source_script $FOAM_BASHRC \
41
45
'.[$app] |= if . == null then
42
46
{
43
47
fork: "foam-extend",
44
48
branch: $branch,
45
49
commit: $commit,
46
- source_script: "/opt/foam/foam-extend-{{ FRAMEWORK_VERSION }}/etc/bashrc" ,
50
+ source_script: $source_script ,
47
51
version: "{{ FRAMEWORK_VERSION }}"
48
52
}
49
53
else . +
50
54
{
51
55
fork: "foam-extend",
52
56
branch: $branch,
53
57
commit: $commit,
54
- source_script: "/opt/foam/foam-extend-{{ FRAMEWORK_VERSION }}/etc/bashrc" ,
58
+ source_script: $source_script ,
55
59
version: "{{ FRAMEWORK_VERSION }}"
56
60
} end' /apps.json > /tmp/apps.json
57
61
mv /tmp/apps.json /apps.json
@@ -60,12 +64,12 @@ From: containers/basic/{{ BASE_CONTAINER }}.sif
60
64
#!/bin/bash
61
65
jq -r '.. | .source_script? // empty' /apps.json | while read -r script; do
62
66
if [[ -f "$script" ]]; then
63
- source "$script"
67
+ ( source "$script")
64
68
fi
65
69
done
66
70
jq -r '.. | .python_env? // empty' /apps.json | while read -r script; do
67
71
if [[ -f "$script" ]]; then
68
- source "$script/bin/activate"
72
+ source "$script/bin/activate"
69
73
fi
70
74
done
71
75
0 commit comments