-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (80 loc) · 1.55 KB
/
Makefile
File metadata and controls
91 lines (80 loc) · 1.55 KB
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
88
89
90
91
# https://stackoverflow.com/a/23324703
SCRIPTS = $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))/scripts
# Open command
ifeq ($(OS), Windows_NT)
OPEN := start
else
UNAME := $(shell uname -s)
ifeq ($(UNAME), Linux)
OPEN := xdg-open
else ifeq ($(UNAME), Darwin)
OPEN := open
endif
endif
.PHONY: all
# .SILENT: all
all:
$(MAKE) submodules
$(MAKE) sync NO_GIT_INFO=1
$(MAKE) import NO_GIT_INFO=1
$(MAKE) status
$(MAKE) diff
.PHONY: sync
.SILENT: sync
sync:
$(SCRIPTS)/sync.zsh
ifeq ($(NO_GIT_INFO),)
$(MAKE) status
$(MAKE) diff
endif
.PHONY: import
.SILENT: import
import:
$(SCRIPTS)/import.zsh
ifeq ($(NO_GIT_INFO),)
$(MAKE) status
$(MAKE) diff
endif
.PHONY: status
.SILENT: status
status:
$(SCRIPTS)/status.sh
.PHONY: diff
.SILENT: diff
diff:
$(SCRIPTS)/diff.sh
.PHONY: tree
.SILENT: tree
tree:
tree \
-a \
-I '.git|.gitignore|.idea|Makefile|README.md|img|import.zsh|util'
.PHONY: start-docker
start-docker:
ifeq ($(UNAME), Darwin)
@if ! docker info > /dev/null 2>&1; then \
echo "Docker is not running. Attempting to start Docker.app..."; \
open -a Docker; \
echo "Waiting for Docker to start..."; \
while ! docker info > /dev/null 2>&1; do \
sleep 1; \
done; \
echo "Docker is now running."; \
fi
endif
.PHONY: gitleaks
.SILENT: gitleaks
gitleaks: start-docker
docker run \
--rm \
--name gitleaks \
--env RUN_LOCAL=true \
--volume $(shell pwd -P):/tmp \
zricethezav/gitleaks:latest \
--source="/tmp" \
--verbose \
--redact \
detect
.PHONY: submodules
submodules:
git submodule update --init --recursive