File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5+ FLAKE_INPUT=${FLAKE_INPUT:- " " }
6+
57if ! git config --get user.name > /dev/null 2>&1 || \
68 [ " $( git config --get user.name) " = " " ] ||
79 ! git config --get user.email > /dev/null 2>&1 || \
1517current_commit=" $( git rev-parse HEAD) "
1618export PRE_COMMIT_ALLOW_NO_CONFIG=1
1719
18- nix flake update --accept-flake-config --commit-lock-file
20+ nix flake update $FLAKE_INPUT --accept-flake-config --commit-lock-file
1921commit_after_update=" $( git rev-parse HEAD) "
2022
2123if [[ " $commit_after_update " = " $current_commit " ]]; then
22- echo " All flake inputs are up to date."
24+ if [[ " $FLAKE_INPUT " = " " ]]; then
25+ echo " All flake inputs are up to date."
26+ else
27+ echo " $FLAKE_INPUT input is up to date."
28+ fi
2329 exit 0
2430fi
2531
@@ -30,11 +36,18 @@ msg_file=./commit_msg_body.txt
3036 echo ' ```'
3137} > $msg_file
3238
33- git commit --amend -F - << EOF
34- chore(flake.lock): Update all Flake inputs ($( date -I) )
39+ if [[ " $FLAKE_INPUT " = " " ]]; then
40+ git commit --amend -F - << EOF
41+ "chore(flake.lock): Update all Flake inputs ($( date -I) )"
42+ $( cat $msg_file )
43+ EOF
44+ else
45+ git commit --amend -F - << EOF
46+ "chore(flake.lock): Update "$FLAKE_INPUT " Flake input ($( date -I) )"
3547
3648$( cat $msg_file )
3749EOF
50+ fi
3851
3952if [ -z " ${CI+x} " ]; then
4053 rm -v $msg_file
You can’t perform that action at this time.
0 commit comments