generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
36 lines (29 loc) · 899 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
MAKEFLAGS += --warn-undefined-variables
SHELL := /bin/bash
ARGS :=
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := help
.PHONY: $(shell egrep -oh ^[a-zA-Z0-9][a-zA-Z0-9_-]+: $(MAKEFILE_LIST) | sed 's/://')
help: ## Print this help
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9][a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "[ERROR] Required: $* !!"; \
echo "[ERROR] Please set --> $*"; \
exit 1; \
fi
#------
release: guard-version ## [Required: $version. ex. 0.5.1]
@echo '1. Update versions'
@sed -i -r 's/\"version\": \".+\"/\"version\": \"$(version)\"/g' manifest.json
@git add manifest.json
@git commit -m "Update manifest"
@npm version $(version)
@echo '2. Build'
@npm run build
@echo '3. push'
@git push --tags
@git push