From 395ad534b1cf25fb80f38ee6db0f68aebb233076 Mon Sep 17 00:00:00 2001 From: zinobias Date: Mon, 8 May 2023 10:32:54 +0200 Subject: [PATCH] Added a replaceable variable for the device type in index.html --- .github/workflows/build_and_deploy_ext2_img.yml | 4 +++- index.html | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_deploy_ext2_img.yml b/.github/workflows/build_and_deploy_ext2_img.yml index 7ffab50..96b0e01 100644 --- a/.github/workflows/build_and_deploy_ext2_img.yml +++ b/.github/workflows/build_and_deploy_ext2_img.yml @@ -121,15 +121,17 @@ jobs: # Move required files for gh-pages deployment to the deployment directory $DEPLOY_DIR. - run: sudo mv assets examples tun xterm favicon.ico index.html login.html network.js scrollbar.css serviceWorker.js tower.ico $DEPLOY_DIR - # This step updates the default index.html file by performing the following steps: + # This step updates the default index.html file by performing the following actions: # 1. Replaces all occurrences of UID, GID, and CX_VERSION with their respective input parameters. # 2. Replaces all occurrences of IMAGE_URL with the URL to the image. + # 3. Replaces all occurrences of DEVICE_TYPE to bytes. - name: Adjust index.html run: | sudo sed -i 's#UID#"${{ github.event.inputs.LOGIN_UID }}"#g' ${{ env.DEPLOY_DIR }}index.html sudo sed -i 's#GID#"${{ github.event.inputs.LOGIN_GID }}"#g' ${{ env.DEPLOY_DIR }}index.html sudo sed -i 's#CX_VERSION#${{ github.event.inputs.CX_VERSION }}#g' ${{ env.DEPLOY_DIR }}index.html sudo sed -i 's#IMAGE_URL#"${{ env.IMAGE_NAME }}"#g' ${{ env.DEPLOY_DIR }}index.html + sudo sed -i 's#DEVICE_TYPE#"bytes"#g' ${{ env.DEPLOY_DIR }}index.html # We generate index.list files for our httpfs to function properly. - name: make index.list diff --git a/index.html b/index.html index 266a885..ee52b8c 100644 --- a/index.html +++ b/index.html @@ -264,8 +264,8 @@ { printOnTerm.printError(printOnTerm.getErrorMessage(err)); } - // The variable IMAGE_URL is replaced by Github Actions. - CheerpXApp.create({devices:[{type:"bytes",url:IMAGE_URL,name:"block1"}],mounts:[{type:"ext2",dev:"block1",path:"/"},{type:"cheerpOS",dev:"/app",path:"/app"},{type:"cheerpOS",dev:"/str",path:"/data"},{type:"devs",dev:"",path:"/dev"}], networkInterface}).then(runTest, failCallback); + // The variables IMAGE_URL and DEVICE_TYPE are replaced by Github Actions. + CheerpXApp.create({devices:[{type:DEVICE_TYPE,url:IMAGE_URL,name:"block1"}],mounts:[{type:"ext2",dev:"block1",path:"/"},{type:"cheerpOS",dev:"/app",path:"/app"},{type:"cheerpOS",dev:"/str",path:"/data"},{type:"devs",dev:"",path:"/dev"}], networkInterface}).then(runTest, failCallback); } function initialMessage() {