refactor, split to two versions - cli and service

This commit is contained in:
Jev
2026-05-25 23:28:24 +02:00
parent 79d86961e3
commit 7188b20797
14 changed files with 335 additions and 69 deletions
+32 -20
View File
@@ -9,28 +9,40 @@ echo "Removing old build dir..."
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
echo "Generating project from template..."
cd "$BUILD_DIR"
cookiecutter "$TEMPLATE_DIR" \
--no-input \
project_name="Test Project" \
project_slug="test-project" \
package_name="test_project" \
description="A test project" \
author_name="Test Author" \
author_email="test@example.com" \
version="0.1.0"
run_variant() {
local type="$1"
local slug="demo-$type"
cd "$BUILD_DIR/test-project"
echo "Generated project at: $(pwd)"
echo
echo "=== Generating '$type' variant ==="
cd "$BUILD_DIR"
cookiecutter "$TEMPLATE_DIR" \
--no-input \
project_name="Demo $type" \
project_slug="$slug" \
package_name="demo_$type" \
description="A demo $type project" \
project_type="$type" \
author_name="Test Author" \
author_email="test@example.com" \
version="0.1.0"
echo "Running init.sh..."
bash init.sh
cd "$BUILD_DIR/$slug"
echo "Generated at: $(pwd)"
echo "Running lint..."
uv run invoke lint
echo "Running init.sh..."
# shellcheck disable=SC1091
source init.sh
echo "Running tests..."
uv run invoke test
echo "Running lint..."
uv run invoke lint
echo "All checks passed."
echo "Running tests..."
uv run invoke test
}
run_variant cli
run_variant service
echo
echo "All checks passed for both variants."