forked from EESSI/software-layer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson_to_easystacks.sh
More file actions
executable file
·28 lines (23 loc) · 874 Bytes
/
json_to_easystacks.sh
File metadata and controls
executable file
·28 lines (23 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
input_file=$1
prev_eb_version="0.0.0"
#prev_toolchain="none"
easystack_num=0
while read app
do
eval $(echo $app | jq -r '. | to_entries | .[] | .key + "=" + (.value | @sh)')
#if [[ ${prev_toolchain} != ${toolchain} ]] || [[ ${prev_eb_version} != ${easybuild} ]]; then
if [[ ${prev_eb_version} != ${easybuild} ]]; then
easystack_num=$(( easystack_num + 1))
#prev_toolchain=${toolchain}
prev_eb_version=${easybuild}
fi
#easystack="$(printf '%03d\n' ${easystack_num})-eb-${easybuild}-${toolchain}.yml"
easystack="$(printf '%03d\n' ${easystack_num})-eb-${easybuild}.yml"
if [ ! -f "${easystack}" ]; then
echo "easyconfigs:" > ${easystack}
fi
echo " - ${easyconfig}:" >> ${easystack}
echo " options:" >> ${easystack}
echo " include-easyblocks: ${easyblocks}" >> ${easystack}
done < <(jq -c '.[]' ${input_file})