Skip to content

Commit 36b9c8e

Browse files
committed
fix: iterating over file array
1 parent adb0726 commit 36b9c8e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/copy-templates.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ root="$(pwd)"
1313

1414
pushd "$TARGET" > /dev/null
1515

16-
for f in $(jq -r '.config.files[] // []' <<< "$CONTEXT"); do
16+
for f in $(jq -r '.config.files // [] | .[]' <<< "$CONTEXT"); do
1717
if [[ -f "$f" && "$force" != "true" ]]; then
1818
# Temporarily always force copy .github/workflows/stale-issue.yml and .github/workflows/semantic-pull-request.yml
1919
if [[ "$f" != ".github/workflows/stale-issue.yml" && "$f" != ".github/workflows/semantic-pull-request.yml" ]]; then
@@ -82,7 +82,7 @@ if [[ "$force" != "true" ]]; then
8282
done <<< "$(jq -c '.["updated-dependency-files"] | .[] // []' <<< "$pr")"
8383
done <<< "$(yq -c '.output | map(select(.type == "create_pull_request")) | map(.expect.data) | .[]' "$plan")"
8484

85-
for f in $(jq -r '.config.files[] // []' <<< "$CONTEXT"); do
85+
for f in $(jq -r '.config.files // [] | .[]' <<< "$CONTEXT"); do
8686
if [[ ! -f "$f" ]]; then
8787
echo "$f does not exist. Skipping."
8888
continue

scripts/delete-templates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -euo pipefail -o nounset
44

5-
for f in $(jq -r '.config.files[]' <<< "$CONTEXT"); do
5+
for f in $(jq -r '.config.files // [] | .[]' <<< "$CONTEXT"); do
66
echo -e "\nProcessing $f."
77
if [[ ! -f "$TARGET/$f" ]]; then
88
echo "$f does not exist. Skipping.\n"

0 commit comments

Comments
 (0)