Skip to content

Commit 4a3efbe

Browse files
szkibajdbaldry
andauthored
Since we're using Bash, I think local variables can really help with function readabliity
thanks @jdbaldry Co-authored-by: Jack Baldry <[email protected]>
1 parent 56e9823 commit 4a3efbe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/extension-registry-changed

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ curl -sL https://registry.k6.io/registry.json |
2626
}
2727

2828
replace_extension_list_partial() {
29-
ed -s $1 <<EOF
29+
local -r outfile="$1"
30+
local -r infile="$2"
31+
32+
ed -s "$outfile" <<EOF
3033
/<div class=.nav-cards.>/+,/<.div>/-d
31-
/<div class=.nav-cards.>/ r $2
34+
/<div class=.nav-cards.>/ r "$infile"
3235
w
3336
q
3437
EOF

0 commit comments

Comments
 (0)