-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrapper_script.nix
More file actions
39 lines (33 loc) · 968 Bytes
/
Copy pathwrapper_script.nix
File metadata and controls
39 lines (33 loc) · 968 Bytes
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
{ pkgs, lambdananas }:
(pkgs.writeShellScriptBin "hcs" ''
start_time=$(date +%s)
if [ -z "$1" ]; then
project_dir=$(pwd)
else
project_dir="$1"
fi
echo "Running norm in $project_dir"
count=$(find "$project_dir" \
-type f \
-not -path "*/.direnv/*" \
-not -path "*/.git/*" \
-not -path "*/.idea/*" \
-not -path "*/.vscode/*" \
-not -path "*/bonus/*" \
-not -path "*/tests/*" \
-not -path "*/*build/*" \
-not -path "*/Setup.hs" \
-name "*.hs" \
| ${lambdananas}/bin/lambdananas \
2>&1 \
| sed "s|$project_dir/||" \
| tee /dev/stderr | wc -l
)
echo "Found $count issues"
end_time=$(date +%s)
echo "Ran in $((end_time - start_time))s"
if [ $count -gt 0 ]; then
exit 1
fi
exit 0
'')