-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathutils.sh
executable file
·57 lines (47 loc) · 1.02 KB
/
utils.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
#!/bin/bash
set -e
function build {
cabal v2-build -j nix-package-versions-exe
}
function watch-exe {
ghcid -c 'cabal v2-repl' nix-package-versions-exe
}
function watch-lib {
ghcid -c 'cabal v2-repl' nix-package-versions
}
function watch-test {
ghcid -c 'cabal v2-repl' nix-package-versions-test
}
function test {
cabal v2-run nix-package-versions-test
}
function server {
cabal v2-run nix-package-versions-exe -- \
server \
--port 8080 \
--db-root database
}
function update-database {
# Load GitHub credentials
source $(pwd)/.secrets
echo $GITHUB_USER
echo $GITHUB_TOKEN
cabal v2-run nix-package-versions-exe -- \
update \
--from 2024-01-01 \
--github-user $GITHUB_USER \
--github-token $GITHUB_TOKEN \
--db-root database \
+RTS -N
}
# If the first argument is a function run it.
if [[ $(type -t $1) == function ]];
then
$1 "${@:2}";
else
echo "Development utilities"
echo "To perform commands run:"
echo ""
echo " ./utils.sh COMMAND"
echo ""
fi