aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2023-03-08 08:58:54 +0100
committerPatrick Spek <p.spek@tyil.nl>2023-03-08 08:58:54 +0100
commit61e464e037a7436a2ac050fac8258094ba095514 (patch)
tree744b83a54f5cfb2c35c71a9b08cc304b6e06cd50
parente4a5cb6416a8908a65e274cd00f7ea04f5094d77 (diff)
Add diff subcommand
-rw-r--r--lib/main.bash2
-rw-r--r--lib/subcommands/diff.bash (renamed from lib/subcommands/patch.bash)6
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/main.bash b/lib/main.bash
index 6a8d7e8..12033db 100644
--- a/lib/main.bash
+++ b/lib/main.bash
@@ -77,6 +77,7 @@ Usage:
$BASHTARD_NAME -h
$BASHTARD_NAME add <playbook>
$BASHTARD_NAME del <playbook>
+ $BASHTARD_NAME diff
$BASHTARD_NAME init [repository]
$BASHTARD_NAME pkg <install|uninstall> <name>
$BASHTARD_NAME ssh <command>
@@ -92,6 +93,7 @@ Commands:
init Initialize the $BASHTARD_NAME configuration system.
pkg Interface into the pkg abstraction used by $BASHTARD_NAME.
del Remove a configuration playbook from this machine.
+ diff Show a diff of all uncommitted changes.
ssh Run a given command on all known hosts.
sync Pull latest changes through git, and synchronize all added
playbooks.
diff --git a/lib/subcommands/patch.bash b/lib/subcommands/diff.bash
index 72350ef..1cb8c71 100644
--- a/lib/subcommands/patch.bash
+++ b/lib/subcommands/diff.bash
@@ -7,9 +7,5 @@
subcommand()
{
chgdir "$BASHTARD_ETCDIR"
- git add . \
- && git diff --cached \
- && git reset \
- && git restore . \
- && git clean -fd
+ git -C "$BASHTARD_ETCDIR" diff
}