File tree Expand file tree Collapse file tree 1 file changed +21
-12
lines changed
Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Original file line number Diff line number Diff line change 666666 # Enable nullglob so the wildcard expands to nothing if no files match
667667 shopt -s nullglob
668668
669- # Find and use the first manifest if it exists
670- first_manifest=""
671- for file in $CYLC_WORKFLOW_SHARE_DIR/*diag_manifest.yaml; do
672- first_manifest=$file
673- break
669+ # Initialize an empty array to hold our command-line arguments
670+ use_diag_manifest=()
671+ found_manifest="false"
672+
673+ # Loop through all matching files and append them to the array
674+ for file in "$CYLC_WORKFLOW_SHARE_DIR"/cycle/$CYLC_TASK_CYCLE_POINT/*diag_manifest.yaml.*; do
675+ use_diag_manifest+=("--diag-manifest=$file")
676+ found_manifest="true"
674677 done
675- if [[ -n $first_manifest ]]; then
676- cp $CYLC_WORKFLOW_SHARE_DIR/*diag_manifest.yaml .
677- use_diag_manifest="--diag-manifest=$first_manifest"
678- else
679- use_diag_manifest=""
678+
679+ # If the array has at least one item, copy the files
680+ if [[ "$found_manifest" == "true" ]]; then
681+ cp "$CYLC_WORKFLOW_SHARE_DIR"/cycle/$CYLC_TASK_CYCLE_POINT/*diag_manifest.yaml.* .
680682 fi
681683
682- mkdir -p $outputDir
683- fre -vv pp rename-split --input-dir=$inputDir --output-dir=$outputDir --component=$component $use_subdirs $use_diag_manifest
684+ mkdir -p "$outputDir"
685+
686+ # Expand the array into separate arguments using "${array[@]}"
687+ fre -vv pp rename-split \
688+ --input-dir="$inputDir" \
689+ --output-dir="$outputDir" \
690+ --component="$component" \
691+ $use_subdirs \
692+ "${use_diag_manifest[@]}"
684693 """
685694
686695{% if DO_NATIVE %}
You can’t perform that action at this time.
0 commit comments