summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-12-17 13:36:51 +0200
committerLars Wirzenius <liw@liw.fi>2022-12-17 13:36:51 +0200
commitd012faa073ffbcf76d538cc4fe739bb7a3a386e8 (patch)
treeca77398833662e36f21dca889188a26abead352c
parentf4e9fe37130fb6d22a408a4db92746d7343cdfd4 (diff)
downloadsshca-d012faa073ffbcf76d538cc4fe739bb7a3a386e8.tar.gz
chore: make ./check obey an offline mode
Sponsored-by: author
-rwxr-xr-xcheck14
-rwxr-xr-xdebian/rules2
2 files changed, 11 insertions, 5 deletions
diff --git a/check b/check
index 2b15e11..ec8dc22 100755
--- a/check
+++ b/check
@@ -5,14 +5,20 @@
set -eu
hideok=chronic
-if [ "$#" -gt 0 ]; then
+offline=
+
+while [ "$#" -gt 0 ]; do
case "$1" in
verbose | -v | --verbose)
hideok=
shift
;;
+ offline | -o | --offline)
+ offline=--offline
+ shift
+ ;;
esac
-fi
+done
require_cmd() {
if ! command -v "$1" >/dev/null; then
@@ -42,7 +48,7 @@ subplot docgen sshca.subplot -o sshca.html
subplot docgen sshca.subplot -o sshca.pdf
got_cargo_cmd clippy && cargo clippy --all-targets -q
-$hideok cargo build --all-targets
-$hideok cargo test
+$hideok cargo build --all-targets $offline
+$hideok cargo test $offline
echo "Everything seems to be in order."
diff --git a/debian/rules b/debian/rules
index eb85db3..8bf4e17 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,4 +11,4 @@ override_dh_auto_install:
find debian/ -name '.crates*' -delete
override_dh_auto_test:
- ./check
+ ./check --offline