Skip to content

Commit

Permalink
parse config updates for fslmerge step
Browse files Browse the repository at this point in the history
  • Loading branch information
lmperry committed Jun 28, 2018
1 parent c5f045b commit 1e1cbb5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
28 changes: 22 additions & 6 deletions fslmerge/source/run
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,28 @@ catTR_flag=$(jq -r <$MANIFEST '''.config.catTR.id')
###############################################################################
# Parse config options from CONFIG file or MANIFEST

if [[ -f $CONFIG_FILE ]]; then
eval $(jq -r '.config | to_entries[] | "config_\(.key)=\(.value)"' $CONFIG_FILE)
else
CONFIG_FILE=$MANIFEST
eval $(jq -r '.config | to_entries[] | "config_\(.key)=\(.value.default)"' $CONFIG_FILE)
fi
function parse_config {

CONFIG_FILE=$FLYWHEEL_BASE/config.json
MANIFEST_FILE=$FLYWHEEL_BASE/manifest.json

if [[ -f $CONFIG_FILE ]]; then
echo -e "$(cat $CONFIG_FILE | jq -r '.config.'$1)"
else
CONFIG_FILE=$MANIFEST_FILE
echo -e "$(cat $MANIFEST_FILE | jq -r '.config.'$1'.default')"
fi

}

# String parsing
config_catTime="$(parse_config 'catTime')"
config_catX="$(parse_config 'catX')"
config_catY="$(parse_config 'catY')"
config_catZ="$(parse_config 'catZ')"
config_auto="$(parse_config 'auto')"
config_catTR="$(parse_config 'catTR')"
config_base_outname="$(parse_config 'base_outname')"

# Boolean parsing
if [[ $config_catTime == 'true' ]]; then
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"source": "https://github.com/scitran-apps/afq-pipline",
"license": "GPL-2.0",
"flywheel": "0",
"version": "1.0.2",
"version": "1.0.3",
"custom": {
"docker-image": "scitran/afq-pipeline:1.0.2"
"docker-image": "scitran/afq-pipeline:1.0.3"
},
"inputs": {
"anatomical": {
Expand Down

0 comments on commit 1e1cbb5

Please sign in to comment.