-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBakefile.sh
More file actions
46 lines (39 loc) · 1.27 KB
/
Bakefile.sh
File metadata and controls
46 lines (39 loc) · 1.27 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
# shellcheck shell=bash
init() {
source ~/.dotfiles/os-unix/data/setup-private.sh
}
task.init() {
git config set --local filter.npmrc.clean './scripts/npmrc-clean.sh'
git config set --local filter.oscrc.clean './scripts/oscrc-clean.sh'
cat > .clangd <<EOF
# DO NOT MODIFY! This file is auto-autogenerated from Bakefile.sh.
CompileFlags:
Add: ['-DCONFIG_HOME=$HOME']
EOF
if ! grep -q '.clangd' .git/info/exclude; then
printf '%s\n' '.clangd' >> .git/info/exclude
fi
}
task.build() {
# grep '-P' does not with with multiple arguments using '-e'.
for pattern in "${_private_forbidden_patterns[@]}"; do
if grep -IPr --exclude setup-private.* --exclude .clangd --exclude-dir node_modules --exclude-dir .data --exclude-dir vendor --color=always "$pattern" ./ | grep -Ev '(#|//|") lint-ignore'; then
bake.die "Expected to find no matches for '$pattern'"
fi
done
cd "./os-unix/config-linux-rice/.config/X11/resources" || exit
printf '%s\n' "! GENERATED BY 'bake build'" > uxterm.Xresources
sed 's/XTerm/UXTerm/g' xterm.Xresources >> uxterm.Xresources
}
task.lint() {
yamllint -c ./.yamllint.yaml .
}
task.test() {
bats -p './os-unix/config-shell/.config/sh'
./os-unix/scripts/lint-scripts.py
}
task.commit() {
local date=
date=$(date '+%Y-%m-%d')
git commit -m "$date" "$@"
}