aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-11-16 20:01:43 -0300
committerEuAndreh <eu@euandre.org>2020-11-16 20:01:43 -0300
commit635fb5e9c11769d935f75c7eeb9e91c11e4f23bc (patch)
treecd14e0d5dcf0f123c4bae56a118f8bef7cc3da21
parentForget existing resource to start working on new VPS (diff)
downloadserver-635fb5e9c11769d935f75c7eeb9e91c11e4f23bc.tar.gz
server-635fb5e9c11769d935f75c7eeb9e91c11e4f23bc.tar.xz
Fix tests.sh
-rwxr-xr-xnixos-switch.sh1
-rwxr-xr-xscripts/assert-todos.sh32
2 files changed, 1 insertions, 32 deletions
diff --git a/nixos-switch.sh b/nixos-switch.sh
index 7ddbec9..1e46434 100755
--- a/nixos-switch.sh
+++ b/nixos-switch.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash
# shellcheck shell=bash
+# shellcheck disable=2086
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
diff --git a/scripts/assert-todos.sh b/scripts/assert-todos.sh
index c3139d1..7c32524 100755
--- a/scripts/assert-todos.sh
+++ b/scripts/assert-todos.sh
@@ -9,35 +9,3 @@ if grep -R FIXME $(git ls-files) | grep -v '^TODOs.org' | grep -v '^.git/' | gre
echo "You should write them down properly on TODOs.org."
exit 1
fi
-
-contains-element() {
- local e match="$1"
- shift
- for e; do [[ "$e" == "$match" ]] && return 0; done
- return 1
-}
-
-KNOWN_IDS=()
-has_error=0
-# shellcheck disable=2013
-for todo in $(sed -e '/^\* Tasks$/,/^\* Improvements$/!d' TODOs.org | grep -nE '^\*\* .*$' | cut -d: -f1); do
- if grep -E '^\*\* (CANCELLED|DONE)' <(sed "${todo}q;d" TODOs.org) > /dev/null; then
- ID_OFFSET=3
- else
- ID_OFFSET=2
- fi
- ID="$(sed "$((todo+ID_OFFSET))q;d" TODOs.org)"
- if grep '^:CUSTOM_ID: .*$' <(echo "$ID") > /dev/null; then
- if contains-element "$ID" "${KNOWN_IDS[@]}"; then
- echo "Duplicated ID: $ID"
- has_error=1
- else
- KNOWN_IDS+=("$ID")
- fi
- else
- echo "Missing ID for TODO in line $todo"
- has_error=1
- fi
-done
-
-exit "$has_error"