-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathproject.sh
executable file
·72 lines (57 loc) · 1.2 KB
/
project.sh
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
#!/usr/bin/env bash
CABAL_FLAGS=""
cmd="$1"
shift
case "$cmd" in
install)
cabal new-install \
--symlink-bindir=$HOME/.local/bin \
-j8 --overwrite-policy=always --disable-documentation \
exe:hw-json
$CABAL_FLAGS "$@"
;;
build)
cabal new-build all -j8 \
--disable-tests --disable-benchmarks \
$CABAL_FLAGS "$@"
;;
exec)
cabal new-exec "$(echo *.cabal | cut -d . -f 1)" "$@"
;;
test)
cabal new-test -j8 --enable-tests --disable-documentation \
$CABAL_FLAGS "$@"
;;
bench)
cabal new-bench -j8 \
$CABAL_FLAGS "$@"
;;
repl)
cabal new-repl \
$CABAL_FLAGS "$@"
;;
clean)
cabal new-clean
;;
publish)
for x in */*.cabal; do
(
echo "== $(dirname $x) =="
cd $(dirname $x)
cabal check
cabal v2-sdist
)
done
cabal upload --publish dist-newstyle/sdist/*.tar.gz
;;
*)
echo "Unrecognised command: $cmd"
exit 1
;;
esac
# haskell-ide-engine work-around
for x in $(find dist-newstyle -name setup-config | grep '/opt/setup-config$' | sed 's|/opt/setup-config$||g'); do
( cd $x
ln -fs opt/setup-config setup-config
)
done