Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- SP_CORE_DIR="$CI_PROJECT_DIR/superpowers/core"
- SP_GAME_DIR="$SP_CORE_DIR/systems/game"
- BUILD_DIR="$CI_PROJECT_DIR/build"
- # Initialize build dir...
- mkdir -p "$BUILD_DIR"
- rm -rf "$BUILD_DIR"/*
- # Copy game system plugins...
- cd "$SP_GAME_DIR"
- for plugin in plugins/*/*/
- do
- echo "Found mainline game plugin '$plugin'."
- mkdir -p "$BUILD_DIR/$plugin/bundles/"
- cp "$plugin/public/bundles"/{components.js,runtime.js,typescriptAPI.js} "$BUILD_DIR/$plugin/bundles/"
- done
- cd "$CI_PROJECT_DIR/ci"
- for plugin in plugins/*/*/
- do
- echo "Found third-party game plugin '$plugin'."
- mkdir -p "$BUILD_DIR/$plugin/bundles/"
- cp "$plugin/public/bundles"/{components.js,runtime.js,typescriptAPI.js} "$BUILD_DIR/$plugin/bundles/"
- done
- # Copy project assets...
- cd "$CI_PROJECT_DIR"
- for asset in assets/*/*/
- do
- echo "Found project asset '$asset'."
- mkdir -p "$BUILD_DIR/$asset"
- cp -R "$asset"/* "$BUILD_DIR/$asset"
- done
- # Copy project resources...
- cd "$CI_PROJECT_DIR"
- for resource in resources/*/
- do
- echo "Found project ressource '$resource'."
- mkdir -p "$BUILD_DIR/$resource"
- cp -R "$resource"/* "$BUILD_DIR/$resource"
- done
- # Copy system files...
- echo "Copying system files..."
- cd "$SP_CORE_DIR"
- cp public/SupCore.js "$BUILD_DIR"
- cp systems/game/public/SupEngine.js "$BUILD_DIR"
- cp systems/game/public/SupRuntime.js "$BUILD_DIR"
- cd "$CI_PROJECT_DIR"
- cp -R ci/files/* "$BUILD_DIR"
- cat entries.json | jq '{name: "Will", assets: .nodes}' > "$BUILD_DIR"/project.json
- # Cleanup build directory...
- echo "All done!"
- cd "$BUILD_DIR"
- find . -type f -name draft.ts -delete
- # find . -type d -empty -delete
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement