feat: init

This commit is contained in:
h
2026-05-21 10:23:01 +02:00
commit 2b00fa44d5
13 changed files with 1189 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
PLUGIN_ID := beaver
ASSETS := manifest.json main.js versions.json
PM := $(shell command -v pnpm 2>/dev/null || command -v npm 2>/dev/null)
.PHONY: install zip _build
_build:
@test -n "$(PM)" || (echo "no pnpm or npm in PATH" >&2; exit 1)
$(PM) install --silent
$(PM) run build
install: _build
@test -n "$(VAULT)" || (echo "set VAULT=<path-to-vault>" >&2; exit 1)
@test -d "$(VAULT)/.obsidian" || (echo "no .obsidian dir at $(VAULT)" >&2; exit 1)
@target="$(VAULT)/.obsidian/plugins/$(PLUGIN_ID)"; \
mkdir -p "$$target"; \
cp $(ASSETS) "$$target/"; \
echo "installed → $$target"
zip: _build
@version=$$(node -p "require('./manifest.json').version"); \
out="beaver-plugin-$$version.zip"; \
rm -f "$$out"; \
zip -q -j "$$out" $(ASSETS); \
echo "wrote $$out"