commit 214f3ce1dd0039621cf94cd4ac62ac949d19cfa6 parent 052d646b8b11edaf112b209a0978e748a097ba8a Author: Fred Großkopf <fred@kuandu.systems> Date: Fri, 1 May 2026 23:19:49 +0200 Renames gitpages-init.sh Now called gitpages-regenerate.sh Diffstat:
| R | gitpages-init.sh -> gitpages-regenerate.sh | | | 0 | |
| D | test-gitpages-init.sh | | | 49 | ------------------------------------------------- |
| A | test-gitpages-regenerate.sh | | | 49 | +++++++++++++++++++++++++++++++++++++++++++++++++ |
3 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/gitpages-init.sh b/gitpages-regenerate.sh diff --git a/test-gitpages-init.sh b/test-gitpages-init.sh @@ -1,49 +0,0 @@ -#!/bin/sh -set -e - -# Configuration -TEST_DIR=$(realpath "$(mktemp -d)") -CONFIG_FILE="$TEST_DIR/gitpages.conf" -GIT_SRC="$TEST_DIR/src" -GIT_RAW="$TEST_DIR/raw" -ASSETS_DIR="$TEST_DIR/assets" - -# Mock dependencies so we don't need real binaries -mkdir -p "$TEST_DIR/bin" -export PATH="$TEST_DIR/bin:$PATH" - -# The mock script correctly uses the filename as the identifier -mock_bin() { - cat << EOF > "$TEST_DIR/bin/$1" -#!/bin/sh -echo "MOCK: $1 called with \$*" -exit 0 -EOF - chmod +x "$TEST_DIR/bin/$1" -} - -# Generate mocks -mock_bin gitpages-mirror-git.sh -mock_bin gitpages.sh -mock_bin git -mock_bin stagit -mock_bin stagit-index - -# Setup test environment -mkdir -p "$GIT_SRC" "$GIT_RAW" "$ASSETS_DIR" - -# Create at least one dummy repo file so the loop in gitpages-init.sh triggers -touch "$GIT_RAW/myrepo.git" - -# Create test config -cat <<EOF > "$CONFIG_FILE" -GIT_SRC=$GIT_SRC -GIT_RAW=$GIT_RAW -EOF - -echo "Running test on gitpages-init.sh..." -./gitpages-init.sh -c "$CONFIG_FILE" - -# Clean up -rm -rf "$TEST_DIR" -echo "PASS: Init script executed successfully." diff --git a/test-gitpages-regenerate.sh b/test-gitpages-regenerate.sh @@ -0,0 +1,49 @@ +#!/bin/sh +set -e + +# Configuration +TEST_DIR=$(realpath "$(mktemp -d)") +CONFIG_FILE="$TEST_DIR/gitpages.conf" +GIT_SRC="$TEST_DIR/src" +GIT_RAW="$TEST_DIR/raw" +ASSETS_DIR="$TEST_DIR/assets" + +# Mock dependencies so we don't need real binaries +mkdir -p "$TEST_DIR/bin" +export PATH="$TEST_DIR/bin:$PATH" + +# The mock script correctly uses the filename as the identifier +mock_bin() { + cat << EOF > "$TEST_DIR/bin/$1" +#!/bin/sh +echo "MOCK: $1 called with \$*" +exit 0 +EOF + chmod +x "$TEST_DIR/bin/$1" +} + +# Generate mocks +mock_bin gitpages-mirror-git.sh +mock_bin gitpages.sh +mock_bin git +mock_bin stagit +mock_bin stagit-index + +# Setup test environment +mkdir -p "$GIT_SRC" "$GIT_RAW" "$ASSETS_DIR" + +# Create at least one dummy repo file so the loop in gitpages-regenerate.sh triggers +touch "$GIT_RAW/myrepo.git" + +# Create test config +cat <<EOF > "$CONFIG_FILE" +GIT_SRC=$GIT_SRC +GIT_RAW=$GIT_RAW +EOF + +echo "Running test on gitpages-regenerate.sh..." +./gitpages-regenerate.sh -c "$CONFIG_FILE" + +# Clean up +rm -rf "$TEST_DIR" +echo "PASS: Init script executed successfully."