summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwd11
1 files changed, 9 insertions, 2 deletions
diff --git a/wd b/wd
index 7e62181..f43b6af 100755
--- a/wd
+++ b/wd
@@ -17,6 +17,8 @@ Usage:
$PROGRAM journal
$PROGRAM edit
+ $PROGRAM git [<args>]
+ Run git command in $WD_NOTES_DIR
_EOF
exit 0
@@ -28,7 +30,7 @@ cmd_version () {
}
cmd_edit () {
- cd "$WD_NOTES_DIR" && $EDITOR "$WD_NOTES_DIR/index.md"
+ $EDITOR "$WD_NOTES_DIR/index.md"
exit 0
}
@@ -58,16 +60,21 @@ cmd_journal () {
[ ! -f "$file_to_edit" ] && echo "$file_title" > "$file_to_edit"
grep -qF "$file_subtitle" "$file_to_edit" || echo "$file_subtitle" >> "$file_to_edit"
- cd "$WD_NOTES_DIR" && $EDITOR "$file_to_edit"
+ $EDITOR "$file_to_edit"
exit 0
}
+cmd_git () {
+ cd "$WD_NOTES_DIR" && git "$@"
+}
+
case "$1" in
help|--help|-h) shift; cmd_usage "$@";;
version|--version|-v) shift; cmd_version "$@";;
journal|j) shift; cmd_journal "$@";;
edit|e) shift; cmd_edit "$@";;
+ git|g) shift; cmd_git "$@" ;;
*) cmd_usage "$@";;
esac