aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakob.stendahl <jakob.stendahl@infomedia.dk>2023-01-15 22:45:19 +0100
committerJakob Stendahl <jakob.stendahl@outlook.com>2023-01-15 22:45:19 +0100
commit40a0423208c0863fb5be95f4e6bdc48a25482996 (patch)
tree139c4a799bb7b7f183a8b9c85ff1caae056b9d58
parent1e6f4e166ef3ac73f8bfaf1b98504d7fd660a9ce (diff)
downloadmicrobit-gamepad-40a0423208c0863fb5be95f4e6bdc48a25482996.tar.gz
microbit-gamepad-40a0423208c0863fb5be95f4e6bdc48a25482996.zip
Fix service worker error, update deploy script
-rwxr-xr-xdeploy.sh17
-rw-r--r--src/js/main.js2
-rw-r--r--src/service-worker.js2
3 files changed, 16 insertions, 5 deletions
diff --git a/deploy.sh b/deploy.sh
index 81f23ce..9b8ab74 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -53,13 +53,24 @@ git add .
git commit -m ":rocket: Deploy app v$VERSION"
tput setaf 4
-echo "> Return to controller branch and tag last commit"
+<<<<<<< Updated upstream
+echo "> Return to main branch and tag last commit"
tput sgr0
-git checkout controller
+git checkout main
#git tag "v$VERSION"
-git push -f origin controller
+git push -f origin main
+=======
+echo "> Return to main branch and tag last commit"
+tput sgr0
+
+git checkout main
+
+#git tag "v$VERSION"
+
+git push -f origin main
+>>>>>>> Stashed changes
#git push origin "v$VERSION"
git push origin gh-pages
diff --git a/src/js/main.js b/src/js/main.js
index 801a9eb..3a6f9e9 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -6,7 +6,7 @@ import { Gamepad } from './gamepad';
let sw = "service-worker.js";
if (navigator.serviceWorker) {
navigator.serviceWorker.register(
- sw, {scope: '/hoverbit-ble/'}
+ sw, {scope: '/microbit-gamepad/'}
).then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
diff --git a/src/service-worker.js b/src/service-worker.js
index 96accb3..112a0e7 100644
--- a/src/service-worker.js
+++ b/src/service-worker.js
@@ -1,4 +1,4 @@
-var APP_PREFIX = 'hoverbitcontroller' // Identifier for this app (this needs to be consistent across every cache update)
+var APP_PREFIX = 'microbitgamepad' // Identifier for this app (this needs to be consistent across every cache update)
var VERSION = '{{ VERSION }}' // Version of the off-line cache (change this value everytime you want to update cache)
var CACHE_NAME = APP_PREFIX + VERSION
var URLS = ["{{ CACHE_FILES }}"] // This will be replaced by the deploy-script