Skip to content

Commit

Permalink
Cli on web (#3913)
Browse files Browse the repository at this point in the history
feat: cli on the web
  • Loading branch information
chmelevskij authored May 13, 2024
1 parent 8f34fd6 commit 2ab33f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/js/tabs/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import BuildApi from '../BuildApi';
import { tracking } from '../Analytics';
import { reinitializeConnection } from "../serial_backend";
import CONFIGURATOR from "../data_storage";
import serial from "../serial";
import CliAutoComplete from "../CliAutoComplete";
import UI_PHONES from "../phones_ui";
import { gui_log } from "../gui_log";
import jBox from "jbox";
import { checkChromeRuntimeError } from "../utils/common";
import $ from 'jquery';
import { serialShim } from "../serial_shim";

const serial = serialShim();

const cli = {
lineDelayMs: 15,
Expand Down Expand Up @@ -446,7 +448,7 @@ cli.read = function (readInfo) {
Windows understands (both) CRLF
Chrome OS currently unknown
*/
const data = new Uint8Array(readInfo.data);
const data = new Uint8Array(readInfo.data ?? readInfo);
let validateText = "";
let sequenceCharsToSkip = 0;

Expand Down
6 changes: 4 additions & 2 deletions src/tabs/presets/CliEngine.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import GUI from "../../js/gui";
import { i18n } from "../../js/localization";
import CONFIGURATOR from "../../js/data_storage";
import serial from "../../js/serial";
import { reinitializeConnection } from "../../js/serial_backend";
import { gui_log } from "../../js/gui_log";
import { serialShim } from "../../js/serial_shim";

const serial = serialShim();

export default class CliEngine
{
Expand Down Expand Up @@ -186,7 +188,7 @@ export default class CliEngine
Windows understands (both) CRLF
Chrome OS currently unknown
*/
const data = new Uint8Array(readInfo.data);
const data = new Uint8Array(readInfo.data ?? readInfo);
let validateText = "";
let sequenceCharsToSkip = 0;
for (const charCode of data) {
Expand Down

0 comments on commit 2ab33f1

Please sign in to comment.