mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 06:32:40 +00:00
Updated hcpn script and added hcpn zet config
This commit is contained in:
@@ -2,29 +2,23 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Creates a new `zet` inside the House Call Pro `Zettlekasten` directory.
|
# Creates a new `zet` inside the House Call Pro `Zettlekasten`
|
||||||
|
|
||||||
_create() {
|
_main() {
|
||||||
# Complete
|
config="$HOME/.config/zet/hcp-config.json"
|
||||||
echo "Create..."
|
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() {
|
_main "$@"
|
||||||
|
|
||||||
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}"
|
|
||||||
|
|||||||
3
zet/zet/hcp-config.json
Normal file
3
zet/zet/hcp-config.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"zetDirectory" : "/Volumes/Bucket/Repos/github.com/hhe-dev/hcp-notes"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user