]> git.pld-linux.org Git - projects/cleanbuild.git/commitdiff
Refactor: Add is_bool helper
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 22 Feb 2023 19:07:59 +0000 (21:07 +0200)
committerElan Ruusamäe <glen@pld-linux.org>
Wed, 22 Feb 2023 19:08:23 +0000 (21:08 +0200)
bin/cleanbuild-docker.sh

index 40ed415813cfa99aacab7758b6e2e7a5851bb1fe..cd6641f947c58d9246e2cef8794bff0fb6fbd886 100755 (executable)
@@ -46,6 +46,10 @@ is_no() {
        esac
 }
 
+is_bool() {
+       [ "$1" = "true" -o "$1" = "false" ] || die "Invalid boolean value: $1"
+}
+
 tmpfs() {
        if is_no "${TMPFS:-true}" || [ "$TMPFS" = "0" ]; then
                return
@@ -209,7 +213,7 @@ parse_options() {
                        ;;
                --keep-container)
                        shift
-                       [ "$1" = "true" -o "$1" = "false" ] || die "Invalid boolean value: $1"
+                       is_bool "$1"
                        KEEP_CONTAINER=$1
                        ;;
                --with)
This page took 0.382152 seconds and 4 git commands to generate.