generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
executable file
·50 lines (43 loc) · 2.34 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.NOTPARALLEL: ; # wait for this target to finish
.EXPORT_ALL_VARIABLES: ; # send all vars to shell
.PHONY: all # All targets are accessible for user
.DEFAULT: help # Running Make will run the help target
# -------------------------------------------------------------------------------------------------
# help: @ List available tasks on this project
# -------------------------------------------------------------------------------------------------
help:
@grep -oE '^#.[a-zA-Z0-9]+:.*?@ .*$$' $(MAKEFILE_LIST) | tr -d '#' |\
awk 'BEGIN {FS = ":.*?@ "}; {printf " make%-10s%s\n", $$1, $$2}'
# -------------------------------------------------------------------------------------------------
# init: @ Install the project dependencies
# -------------------------------------------------------------------------------------------------
init:
@test -d node_modules || @npm install
# -------------------------------------------------------------------------------------------------
# start: @ Run the development server
# -------------------------------------------------------------------------------------------------
start: init
@npm run dev
# -------------------------------------------------------------------------------------------------
# build: @ Build the project
# -------------------------------------------------------------------------------------------------
build:
@npm run build
# -------------------------------------------------------------------------------------------------
# version: @ Update the version of the extension
# -------------------------------------------------------------------------------------------------
version:
@npm run version
# -------------------------------------------------------------------------------------------------
# release: @ Create a new release
# -------------------------------------------------------------------------------------------------
release:
$(eval VERSION := $(shell cat manifest.json | jq -r '.version'))
@git tag $(VERSION)
@git push origin --tags
@echo "Release $(VERSION) successfully created!"
# -------------------------------------------------------------------------------------------------
# format: @ Format the code
# -------------------------------------------------------------------------------------------------
format:
@npx prettier 'src/**/*.ts' --write