From c0d40e6f97a388b04f1e89a3c26c04ee6324a6e5 Mon Sep 17 00:00:00 2001 From: "E. S" Date: Mon, 28 Apr 2025 14:53:59 +0300 Subject: [PATCH] deploy: clean up code --- deploy/build_common.sh | 25 +++++++------------------ deploy/build_css.sh | 22 +++++++++++----------- deploy/build_js.sh | 8 ++++---- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/deploy/build_common.sh b/deploy/build_common.sh index 9cd03fd..12d6fe9 100755 --- a/deploy/build_common.sh +++ b/deploy/build_common.sh @@ -19,7 +19,8 @@ die() { } usage() { - local code="$1" + code="$1" + [ -z "$code" ] && code=0 cat < "$dark_file.diff" rm "$dark_file" diff --git a/deploy/build_js.sh b/deploy/build_js.sh index 22ff999..c1e951d 100755 --- a/deploy/build_js.sh +++ b/deploy/build_js.sh @@ -1,14 +1,14 @@ #!/bin/sh DIR=$(cd "$(dirname "$(readlink -f "$0")")" && pwd) -. $DIR/build_common.sh +. "$DIR/build_common.sh" # suckless version of webpack # watch and learn, bitches! build_chunk() { - local name="$1" - local output="$OUTDIR/$name.js" - local not_first=0 + name="$1" + output="$OUTDIR/$name.js" + not_first=0 for file in "$INDIR/$name"/*.js; do # insert newline before out comment [ "$not_first" = "1" ] && echo "" >> "$output"