From 31652a3fae2d44cc66e9a6c7477b9681b9627231 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Fri, 14 Jan 2022 15:29:49 -0500 Subject: [PATCH] Updated hcpn script and added hcpn zet config --- scripts/scripts/hcpn | 40 +++++++++++++++++----------------------- zet/zet/hcp-config.json | 3 +++ 2 files changed, 20 insertions(+), 23 deletions(-) create mode 100644 zet/zet/hcp-config.json diff --git a/scripts/scripts/hcpn b/scripts/scripts/hcpn index 6b05b32..c7cc451 100755 --- a/scripts/scripts/hcpn +++ b/scripts/scripts/hcpn @@ -2,29 +2,23 @@ set -e -# Creates a new `zet` inside the House Call Pro `Zettlekasten` directory. +# Creates a new `zet` inside the House Call Pro `Zettlekasten` -_create() { - # Complete - echo "Create..." +_main() { + config="$HOME/.config/zet/hcp-config.json" + cmd="${1}" + shift + + case "$cmd" in + config) + zet config "$config" "$*";; + *) + break;; + esac + if [ "$#" -eq 0 ]; then + zet "$cmd" --config "$config" && exit "$?"; + fi + zet "$cmd" --config "$config" "$*" } -_commit() { - - echo "Commit..." -} - -dirname="$(isosec)" -mkdir "${HCP_NOTES}/${dirname}" -dir="$HCP_NOTES/$dirname" -readme="$dir/README.md" -title="$*" -printf "# %s\n\n" "${title}" > "${readme}" -message="${title:-"Autocommit message"}" -cd "$dir" -git pull -q -git add -A "$dir" -git commit -m "$message" -git push -cd - -vi "${readme}" +_main "$@" diff --git a/zet/zet/hcp-config.json b/zet/zet/hcp-config.json new file mode 100644 index 0000000..1ff0943 --- /dev/null +++ b/zet/zet/hcp-config.json @@ -0,0 +1,3 @@ +{ + "zetDirectory" : "/Volumes/Bucket/Repos/github.com/hhe-dev/hcp-notes" +} \ No newline at end of file