-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (45 loc) · 1.22 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
.PHONY: clean
clean:
@rm -f cloud-tar cloud-tar-* cloud-tar.tar.gz
.PHONY: tests
tests:
./test/libs/bats/bin/bats test/*.bats
cloud-tar:
@sed -e '/source components\/show-help.sh/ {' \
-e 'r components/show-help.sh' \
-e 'd' \
-e '}' \
-e '/source components\/parse-commands.sh/ {' \
-e 'r components/parse-commands.sh' \
-e 'd' \
-e '}' \
-e '/source components\/parse-backup-args.sh/ {' \
-e 'r components/parse-backup-args.sh' \
-e 'd' \
-e '}' \
-e '/source components\/parse-restore-args.sh/ {' \
-e 'r components/parse-restore-args.sh' \
-e 'd' \
-e '}' \
-e '/source components\/restore.sh/ {' \
-e 'r components/restore.sh' \
-e 'd' \
-e '}' \
-e '/source components\/backup.sh/ {' \
-e 'r components/backup.sh' \
-e 'd' \
-e '}' \
cloud-tar.sh > cloud-tar
@chmod a+x cloud-tar
@echo './cloud-tar built'
# Test with this...
# GITHUB_REF=refs/tags/2.0.0.RC2 make clean cloud-tar release.tar.gz
release.tar.gz: cloud-tar
tar -cvzf release.tar.gz cloud-tar
cp release.tar.gz cloud-tar-$${GITHUB_REF#refs/tags/}.tar.gz
.PHONY: install
install: cloud-tar
sudo install -m 755 -o root cloud-tar /usr/local/bin/
.PHONY: uninstall
uninstall: clean
@sudo rm -f /usr/local/bin/cloud-tar