Cleanup block device terminology for new API

This commit is contained in:
Alessandro Pignotti 2024-09-27 08:56:54 +02:00
parent b6f5736784
commit 65c0fbf448
2 changed files with 8 additions and 6 deletions

View file

@ -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

View file

@ -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");