Skip to content

Commit 4f34f9c

Browse files
just always apply and use git diff or git restore if need be
1 parent bcbdded commit 4f34f9c

1 file changed

Lines changed: 2 additions & 15 deletions

File tree

ci/ldmx-sw-dependabot

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ fetch() {
2626
}
2727

2828
# update the test workflow with the passed runner and version
29-
# Args:
30-
# 1 : provide to actually apply edit, otherwise just print lines that would change
3129
# Output:
3230
# Edits the ci/runners-to-test.json in place if 3 args provided,
3331
# otherwise just prints lines that would be edited to stdout
@@ -51,12 +49,7 @@ update() {
5149
inf "More than a patch difference, adding ${latest} as a new test to the CI."
5250
jq --arg latest "${latest}" '.ldmx_sw += [$latest]' ci/ldmx-sw-to-test.json > ci/ldmx-sw-to-test.json.upd
5351
fi
54-
if [ -z "${1}" ]; then
55-
diff ci/ldmx-sw-to-test.json ci/ldmx-sw-to-test.json.upd || true
56-
rm ci/ldmx-sw-to-test.json.upd
57-
else
58-
mv ci/ldmx-sw-to-test.json.upd ci/ldmx-sw-to-test.json
59-
fi
52+
mv ci/ldmx-sw-to-test.json.upd ci/ldmx-sw-to-test.json
6053
}
6154

6255
help() {
@@ -70,22 +63,16 @@ help() {
7063
7164
OPTIONS
7265
-h, --help : print this help and exit
73-
--apply : actually edit the ci/ldmx-sw-to-test.json instead of
74-
just printing the lines that have been changed
7566
7667
HELP
7768
}
7869

79-
apply=""
8070
while [ "$#" -gt "0" ]; do
8171
case "$1" in
8272
-h|--help)
8373
help
8474
exit 0
8575
;;
86-
--apply)
87-
apply="APPLY"
88-
;;
8976
*)
9077
help
9178
error "Unrecognized argument '$1'"
@@ -95,4 +82,4 @@ while [ "$#" -gt "0" ]; do
9582
shift
9683
done
9784

98-
update "${apply}"
85+
update

0 commit comments

Comments
 (0)