-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
88 lines (80 loc) · 2.87 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# (C) 2018 Tyson Seto-Mook, Laboratory for Advanced Visualization and Applications, University of Hawaii at Manoa.
# To chane plugin name
# 1) update FULL_NAME and SHORT_NAME
# 2) run target change_name
# 3) if updating again, move new name to old name, then update new name
FULL_NAME = NetSage Sankey
SHORT_NAME = sankeynetsage
DOT_NAME = $(shell echo "$(FULL_NAME)" | tr ' ' '.')
NOSPACE_NAME = $(shell echo "$(FULL_NAME)" | tr -d ' ')
UNDERSCORE_NAME = $(shell echo "$(FULL_NAME)" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
NAME = $(shell echo "$(FULL_NAME)" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
PREV_FULL_NAME = NetSage Boilerplate
PREV_SHORT_NAME = boilerplate
PREV_DOT_NAME = $(shell echo "$(PREV_FULL_NAME)" | tr ' ' '.')
PREV_NOSPACE_NAME = $(shell echo "$(PREV_FULL_NAME)" | tr -d ' ')
PREV_UNDERSCORE_NAME = $(shell echo "$(PREV_FULL_NAME)" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
PREV_NAME = $(shell echo "$(PREV_FULL_NAME)" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
#NAME = netsage-boilerplate
VERSION = 1.0.2
FILES =
FILES += "gulpfile.js"
FILES += "package.json"
FILES += "plugin.json"
FILES += "src/editor.html"
FILES += "src/module.html"
FILES += "src/module.js"
FILES += "src/$(PREV_UNDERSCORE_NAME).js"
FILES += "src/css/$(PREV_SHORT_NAME).css"
install: | build plugin install_plugin reload
quick_install: | gulp_only plugin install_plugin reload
reload:
sudo systemctl stop grafana-server
sleep 1
sudo systemctl start grafana-server
build:
npm install -g gulp
npm install
gulp
gulp_only:
gulp
plugin:
#rm -rf netsage-boilerplate/
mv dist/ $(NAME)/
install_plugin:
sudo rm -rf /var/lib/grafana/plugins/$(NAME)/
sudo mv $(NAME)/ /var/lib/grafana/plugins/
#$(MAKE) reload
name_change:
@#most likely requires vim to work properly
@for f in $(FILES); do \
ex -sc '%s/$(PREV_FULL_NAME)/$(FULL_NAME)/g|x' $$f; \
echo "$$f $(PREV_FULL_NAME) --> $(FULL_NAME)"; \
ex -sc '%s/$(PREV_DOT_NAME)/$(DOT_NAME)/g|x' $$f; \
echo "$$f $(PREV_DOT_NAME) --> $(DOT_NAME)"; \
ex -sc '%s/$(PREV_NOSPACE_NAME)/$(NOSPACE_NAME)/g|x' $$f; \
echo "$$f $(PREV_NOSPACE_NAME) --> $(NOSPACE_NAME)"; \
ex -sc '%s/$(PREV_UNDERSCORE_NAME)/$(UNDERSCORE_NAME)/g|x' $$f; \
echo "$$f $(PREV_UNDERSCORE_NAME) --> $(UNDERSCORE_NAME)"; \
ex -sc '%s/$(PREV_NAME)/$(NAME)/g|x' $$f; \
echo "$$f $(PREV_NAME) --> $(NAME)"; \
ex -sc '%s/$(PREV_SHORT_NAME)/$(SHORT_NAME)/g|x' $$f; \
echo "$$f $(PREV_SHORT_NAME) --> $(SHORT_NAME)"; \
done;
mv "src/$(PREV_UNDERSCORE_NAME).js" "src/$(UNDERSCORE_NAME).js"
super_clean:
rm -rf node_modules package-lock.json dist/ $(NAME)/
test:
@echo $(FULL_NAME)
@echo $(SHORT_NAME)
@echo $(DOT_NAME)
@echo $(NOSPACE_NAME)
@echo $(UNDERSCORE_NAME)
@echo $(NAME)
@echo "-----------"
@echo $(PREV_FULL_NAME)
@echo $(PREV_SHORT_NAME)
@echo $(PREV_DOT_NAME)
@echo $(PREV_NOSPACE_NAME)
@echo $(PREV_UNDERSCORE_NAME)
@echo $(PREV_NAME)