~rootmos/lua-hack

44aafa23c279746f30512ce59380fbee9d98bfd2 — Gustav Behm 5 months ago b86ce78 master
"Move" build-info and theft scripts to the scripts repo
2 files changed, 13 insertions(+), 4 deletions(-)

M scripts/build-info
M scripts/theft
M scripts/build-info => scripts/build-info +9 -4
@@ 1,3 1,6 @@
# build-info
# 2024-06-30T20:47:17+02:00 SHA-256:2991fc3478b9af3127d1fd20dbb4f900f1cf6c73a73f8391a1711d5e0992e758
# https://git.sr.ht/~rootmos/scripts 691a9209493000bfb940e10689d45b4238dbf43f
#!/bin/bash

set -o nounset -o pipefail -o errexit


@@ 6,15 9,15 @@ SCRIPT_DIR=$(readlink -f "$0" | xargs dirname)
ROOT=${ROOT-$(readlink -f "$SCRIPT_DIR/..")}
VERSION_FILE=${VERSION_FILE-$ROOT/.version}

STYLE=env
STYLE="env"
OUTPUT=
PREFIX=BUILD_
TARBALL_SUFFIX=.tar.gz
while getopts "celo:p:z-" OPT; do
    case $OPT in
        c) STYLE=c ;;
        e) STYLE=env ;;
        l) STYLE=lua ;;
        c) STYLE="c" ;;
        e) STYLE="env" ;;
        l) STYLE="lua" ;;
        o) OUTPUT=$OPTARG ;;
        p) PREFIX=$OPTARG ;;
        -) break ;;


@@ 104,6 107,7 @@ EOF
}

if [ -e "$VERSION_FILE" ]; then
    # shellcheck source=/dev/null
    . "$VERSION_FILE"
else
    VERSION_MAJOR=0


@@ 112,6 116,7 @@ else
fi

if [ -f "$ROOT/.build.env" ]; then
    # shellcheck source=/dev/null
    . "$ROOT/.build.env"
elif command -v git >/dev/null \
    && git -C "$ROOT" rev-parse --show-toplevel >/dev/null 2>&1; then

M scripts/theft => scripts/theft +4 -0
@@ 1,3 1,6 @@
# theft
# 2024-06-30T20:47:32+02:00 SHA-256:e6d53d5d1d0304227da15110215229beb8fb32ab6d65b67ebb54d1414e2ddfa5
# https://git.sr.ht/~rootmos/scripts 691a9209493000bfb940e10689d45b4238dbf43f
#!/bin/bash

set -o nounset -o pipefail -o errexit


@@ 61,6 64,7 @@ esac
SHA256=$(sha256sum "$TARGET" | cut -f1 -d' ')

env ROOT="$(dirname "$TARGET")" "$SCRIPT_DIR/build-info" -e -o "$TMP/build-info"
# shellcheck source=/dev/null
. "$TMP/build-info"

echo "$COMMENT_PREFIX $(basename "$TARGET")" | out