diff --git a/.gitignore b/.gitignore index b2d6de3..9f16c88 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # Generated files .docusaurus .cache-loader +static/springroll-io-demo-game # Misc .DS_Store diff --git a/package.json b/package.json index 4fe5a34..9f8d0d1 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "0.0.0", "private": true, "scripts": { + "prebuild": "./scripts/clone-demo-game.sh", + "preserve": "./scripts/clone-demo-game.sh", + "prestart": "./scripts/clone-demo-game.sh", "docusaurus": "docusaurus", "start": "docusaurus start", "build": "docusaurus build", diff --git a/scripts/clone-demo-game.sh b/scripts/clone-demo-game.sh new file mode 100755 index 0000000..a11f2a4 --- /dev/null +++ b/scripts/clone-demo-game.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# Create the folder where we'll drop the demo game contents +rm -rf static/springroll-io-demo-game +mkdir static/springroll-io-demo-game + +# Clone down the demo game +rm -rf springroll-io-demo-game +git clone --depth=1 https://github.com/SpringRoll/springroll-io-demo-game.git +cp -R springroll-io-demo-game/docs/* static/springroll-io-demo-game +rm -rf springroll-io-demo-game diff --git a/src/components/GameDemo/index.tsx b/src/components/GameDemo/index.tsx index 76bf412..de5dc85 100644 --- a/src/components/GameDemo/index.tsx +++ b/src/components/GameDemo/index.tsx @@ -60,7 +60,7 @@ export default function GameDemo(): JSX.Element { }); // Open the game - containerRef.current.openPath('http://springroll.io/springroll-io-demo-game/'); + containerRef.current.openPath('/springroll-io-demo-game/index.html'); }; @@ -115,4 +115,4 @@ export default function GameDemo(): JSX.Element { ); -} \ No newline at end of file +}