diff options
author | Andrew Cady <d@jerkface.net> | 2019-07-29 19:08:45 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2019-07-29 19:09:03 -0400 |
commit | 2e2c4440cbdf967764aae22888df026bb1fc6a74 (patch) | |
tree | 7ff345fc19d5e8788fb275bdea43c174f676329a | |
parent | b97c9e45ff37ee6d6135a525a3c784136adcf188 (diff) |
checkout and run make
-rw-r--r-- | Makefile | 12 | ||||
-rwxr-xr-x | hooks/post-receive | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..71acace --- /dev/null +++ b/Makefile | |||
@@ -0,0 +1,12 @@ | |||
1 | all: build install reload | ||
2 | |||
3 | .PHONY: build install reload | ||
4 | |||
5 | build: | ||
6 | stack build --test | ||
7 | |||
8 | install: | ||
9 | stack install | ||
10 | |||
11 | reload: | ||
12 | systemctl --user reload anomic | ||
diff --git a/hooks/post-receive b/hooks/post-receive index 72dc81d..7f66079 100755 --- a/hooks/post-receive +++ b/hooks/post-receive | |||
@@ -15,5 +15,16 @@ warn() | |||
15 | fi | 15 | fi |
16 | } | 16 | } |
17 | 17 | ||
18 | die() | ||
19 | { | ||
20 | printf '%s: Error: %s\n' "$0" "$*" >&2 | ||
21 | exit 1 | ||
22 | } | ||
23 | |||
18 | GIT_WORK_TREE=. git checkout -f master -- authorized_keys.d/\* | 24 | GIT_WORK_TREE=. git checkout -f master -- authorized_keys.d/\* |
19 | 25 | ||
26 | export GIT_WORK_TREE=${GIT_DIR%.git} | ||
27 | |||
28 | git checkout -f master || die 'command failed: git checkout' | ||
29 | cd "$GIT_WORK_TREE" || die 'command failed: cd $GIT_WORK_TREE' | ||
30 | make | ||