-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add --every flag to update command
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[windows] skip 'UNIX only' | ||
[!exec:git] skip 'git not found in $PATH' | ||
|
||
mkgitconfig | ||
|
||
# create a git repo in home/user/repo | ||
exec git -C $HOME/repo init | ||
exec git -C $HOME/repo add . | ||
exec git -C $HOME/repo commit -m 'Initial commit' | ||
|
||
exec chezmoi init file://$HOME/repo | ||
|
||
# test that chezmoi update runs every time | ||
exec chezmoi update | ||
stdout 'ran update' | ||
exec chezmoi update | ||
stdout 'ran update' | ||
|
||
# test that chezmoi update --every rate limits updates | ||
exec chezmoi update --every=24h | ||
! stdout 'ran update' | ||
exec chezmoi update --every=1ns | ||
stdout 'ran update' | ||
exec chezmoi update --every=24h | ||
! stdout 'ran update' | ||
exec chezmoi update | ||
stdout 'ran update' | ||
|
||
-- home/user/repo/run_after_update.sh -- | ||
#!/bin/sh | ||
|
||
echo "ran update" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters