diff --git a/package.json b/package.json index e16f875..94b29bb 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test": "react-scripts test", "start": "scripts/app_start.sh", "build": "react-scripts build", - "deploy": "gh-pages -d build" + "deploy": "scripts/app_deploy.sh" }, "author": "UBC Launch Pad", "license": "ISC", diff --git a/scripts/app_deploy.sh b/scripts/app_deploy.sh new file mode 100644 index 0000000..d25e51c --- /dev/null +++ b/scripts/app_deploy.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Fetch Unity minigame binaries +scripts/unity_fetch.sh + +# Deploy app +gh-pages -d build \ No newline at end of file diff --git a/scripts/app_start.sh b/scripts/app_start.sh index 8411238..9672200 100755 --- a/scripts/app_start.sh +++ b/scripts/app_start.sh @@ -1,17 +1,7 @@ #!/usr/bin/env bash -# Get minigames release version -release=$(head -n 1 release.txt) -binary_location="https://github.com/ubclaunchpad/ubcsim2/releases/download/${release}/ubcsim2-minigames${release}.zip" - -# Get Unity binaries from release on GitHub -rm -rf temp -rm -rf public/unity -mkdir temp -mkdir public/unity -wget ${binary_location} -O temp/unity.zip -unzip temp/unity.zip -d temp -cp -r temp/ubcsim2-minigames${release}/* public/unity/ +# Fetch Unity minigame binaries +scripts/unity_fetch.sh # Start app react-scripts start \ No newline at end of file diff --git a/scripts/unity_fetch.sh b/scripts/unity_fetch.sh new file mode 100644 index 0000000..5eb9eab --- /dev/null +++ b/scripts/unity_fetch.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Get minigames release version +release=$(head -n 1 release.txt) +binary_location="https://github.com/ubclaunchpad/ubcsim2/releases/download/${release}/ubcsim2-minigames${release}.zip" + +# Get Unity binaries from release on GitHub +rm -rf temp +rm -rf public/unity +mkdir temp +mkdir public/unity +wget ${binary_location} -O temp/unity.zip +unzip temp/unity.zip -d temp +cp -r temp/ubcsim2-minigames${release}/* public/unity/ \ No newline at end of file