Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. SP_CORE_DIR="$CI_PROJECT_DIR/superpowers/core"
  4. SP_GAME_DIR="$SP_CORE_DIR/systems/game"
  5. BUILD_DIR="$CI_PROJECT_DIR/build"
  6.  
  7. # Initialize build dir...
  8. mkdir -p "$BUILD_DIR"
  9. rm -rf "$BUILD_DIR"/*
  10.  
  11. # Copy game system plugins...
  12. cd "$SP_GAME_DIR"
  13. for plugin in plugins/*/*/
  14. do
  15. echo "Found mainline game plugin '$plugin'."
  16. mkdir -p "$BUILD_DIR/$plugin/bundles/"
  17. cp "$plugin/public/bundles"/{components.js,runtime.js,typescriptAPI.js} "$BUILD_DIR/$plugin/bundles/"
  18. done
  19.  
  20. cd "$CI_PROJECT_DIR/ci"
  21. for plugin in plugins/*/*/
  22. do
  23. echo "Found third-party game plugin '$plugin'."
  24. mkdir -p "$BUILD_DIR/$plugin/bundles/"
  25. cp "$plugin/public/bundles"/{components.js,runtime.js,typescriptAPI.js} "$BUILD_DIR/$plugin/bundles/"
  26. done
  27.  
  28. # Copy project assets...
  29. cd "$CI_PROJECT_DIR"
  30. for asset in assets/*/*/
  31. do
  32. echo "Found project asset '$asset'."
  33. mkdir -p "$BUILD_DIR/$asset"
  34. cp -R "$asset"/* "$BUILD_DIR/$asset"
  35. done
  36.  
  37. # Copy project resources...
  38. cd "$CI_PROJECT_DIR"
  39. for resource in resources/*/
  40. do
  41. echo "Found project ressource '$resource'."
  42. mkdir -p "$BUILD_DIR/$resource"
  43. cp -R "$resource"/* "$BUILD_DIR/$resource"
  44. done
  45.  
  46.  
  47. # Copy system files...
  48. echo "Copying system files..."
  49. cd "$SP_CORE_DIR"
  50. cp public/SupCore.js "$BUILD_DIR"
  51. cp systems/game/public/SupEngine.js "$BUILD_DIR"
  52. cp systems/game/public/SupRuntime.js "$BUILD_DIR"
  53. cd "$CI_PROJECT_DIR"
  54. cp -R ci/files/* "$BUILD_DIR"
  55. cat entries.json | jq '{name: "Will", assets: .nodes}' > "$BUILD_DIR"/project.json
  56.  
  57. # Cleanup build directory...
  58. echo "All done!"
  59. cd "$BUILD_DIR"
  60. find . -type f -name draft.ts -delete
  61. # find . -type d -empty -delete
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement