Skip to content

Commit 5b20f5c

Browse files
author
Louis Bertrand
committed
Library Download Tool Using Make
help: $ make or $ make help
1 parent 59a2f26 commit 5b20f5c

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

Makefile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.PHONY: Download_Library Download_Basic_Libraries
2+
.DEFAULT_GOAL=help
3+
4+
LibraryURL=https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/base.zip
5+
LibraryName=base
6+
7+
COM_COLOR = \033[0;34m
8+
OBJ_COLOR = \033[0;36m
9+
OK_COLOR = \033[0;32m
10+
PRIMARY_COLOR = $(OK_COLOR)
11+
ERROR_COLOR = \033[0;31m
12+
WARN_COLOR = \033[0;33m
13+
NO_COLOR = \033[m
14+
15+
help:
16+
@echo "\n"
17+
@awk 'BEGIN {FS = ":.*##"; } /^[a-zA-Z_-]+:.*?##/ { printf "$(PRIMARY_COLOR)%-10s$(NO_COLOR) %s\n", $$1, $$2 }' $(MAKEFILE_LIST) | sort
18+
@echo "\n"
19+
20+
Download_Library: ## download a library with a URL - call this with the correct parametters according to your library
21+
@echo "$(OK_COLOR)"
22+
curl -o libraries/$(LibraryName).zip '$(LibraryURL)'
23+
@echo "$(WARN_COLOR)"
24+
unzip libraries/$(LibraryName).zip -d libraries/
25+
rm libraries/$(LibraryName).zip
26+
@echo "$(OK_COLOR)"
27+
@echo "Download Successful$(NO_COLOR)"
28+
29+
Download_Basic_Libraries: ## download required - or not - basic libraries
30+
@echo "$(OK_COLOR)"
31+
curl -o libraries/base.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/base.zip'
32+
@echo "$(WARN_COLOR)"
33+
unzip libraries/base.zip -d libraries/
34+
@echo "$(OK_COLOR)"
35+
rm libraries/base.zip
36+
curl -o libraries/stdio.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/stdio.zip'
37+
@echo "$(WARN_COLOR)"
38+
unzip libraries/stdio.zip -d libraries/
39+
rm libraries/stdio.zip
40+
@echo "$(OK_COLOR)"
41+
@echo "Download Successful$(NO_COLOR)"
42+
43+
Update_Basic_Libraries: ## update required - or not - basic libraries WARNING: YOUR PREVIOUS VERSION WILL BE OVERWRITTEN
44+
@echo "$(OK_COLOR)"
45+
curl -o libraries/base.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/base.zip'
46+
@echo "$(WARN_COLOR)"
47+
rm -r libraries/base/
48+
unzip libraries/base.zip -d libraries/
49+
rm libraries/base.zip
50+
@echo "$(OK_COLOR)"
51+
curl -o libraries/stdio.zip 'https://raw.githubusercontent.com/PYLOTT/KeyPHP_Basic_Libraries/master/stdio.zip'
52+
@echo "$(WARN_COLOR)"
53+
rm -r libraries/stdio/
54+
unzip libraries/stdio.zip -d libraries/
55+
rm libraries/stdio.zip
56+
@echo "$(OK_COLOR)"
57+
@echo "Updation Successful!!$(NO_COLOR)"

0 commit comments

Comments
 (0)