File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
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,19 @@ 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+
43+ $( cat $msg_file )
44+ EOF
45+ else
46+ git commit --amend -F - << EOF
47+ chore(flake.lock): Update \` $FLAKE_INPUT \` Flake input ($( date -I) )
3548
36- $( cat $msg_file )
49+ $( cat $msg_file )
3750EOF
51+ fi
3852
3953if [ -z " ${CI+x} " ]; then
4054 rm -v $msg_file
You can’t perform that action at this time.
0 commit comments