From 65c0fbf448f0b37c5014a6a9ce54f14629c6d629 Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Fri, 27 Sep 2024 08:56:54 +0200 Subject: [PATCH] Cleanup block device terminology for new API --- .github/workflows/deploy.yml | 2 +- index.html | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0554890..d1eb72d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -181,7 +181,7 @@ jobs: - name: Adjust index.html run: | sudo sed -i 's#IMAGE_URL#"${{ env.IMAGE_NAME }}"#g' ${{ env.DEPLOY_DIR }}index.html - sudo sed -i 's#DEVICE_TYPE#"split"#g' ${{ env.DEPLOY_DIR }}index.html + sudo sed -i 's#DEVICE_TYPE#"github"#g' ${{ env.DEPLOY_DIR }}index.html sudo sed -i 's#CMD#${{ env.CMD }}#g' ${{ env.DEPLOY_DIR }}index.html sudo sed -i 's#ARGS#${{ env.ARGS }}#g' ${{ env.DEPLOY_DIR }}index.html sudo sed -i 's#ENV#${{ env.ENV }}#g' ${{ env.DEPLOY_DIR }}index.html diff --git a/index.html b/index.html index 7f7074c..511d1d4 100644 --- a/index.html +++ b/index.html @@ -271,12 +271,14 @@ __ __ _ __ ____ __ var env = ENV; var cwd = CWD; var device_type = DEVICE_TYPE; + var image_url = IMAGE_URL; // Reasonable defaults for local deployments // var cmd = "/bin/bash"; // var args = ["--login"]; // var env = ["HOME=/home/user", "TERM=xterm", "USER=user", "SHELL=/bin/bash", "EDITOR=vim", "LANG=en_US.UTF-8", "LC_ALL=C"]; // var cwd = "/home/user"; // var device_type = "bytes"; + // var image_url = "/your_local_image.ext2"; const structure = { cmd: cmd, args: args, @@ -342,14 +344,14 @@ __ __ _ __ ____ __ var blockDevice; switch (device_type) { - case "block": - blockDevice = await CheerpX.CloudDevice.create(IMAGE_URL); + case "cloud": + blockDevice = await CheerpX.CloudDevice.create(image_url); break; case "bytes": - blockDevice = await CheerpX.HttpBytesDevice.create(IMAGE_URL); + blockDevice = await CheerpX.HttpBytesDevice.create(image_url); break; - case "split": - blockDevice = await CheerpX.GitHubDevice.create(IMAGE_URL); + case "github": + blockDevice = await CheerpX.GitHubDevice.create(image_url); break; default: console.log("Unrecognized device type");