Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cocktailpeanut committed Mar 22, 2023
1 parent dde228f commit 0404c33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
1 change: 1 addition & 0 deletions bin/web/views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ ${fields}
config.id = "TS-" + Date.now() + "-" + Math.floor(Math.random() * 100000)
document.querySelector("#prompt-run").classList.add("hidden")
document.querySelector("#prompt-cancel").classList.remove("hidden")
delete config.html
localStorage.setItem("config", JSON.stringify(config))
socket.emit('request', config)
config.id = null
Expand Down
19 changes: 2 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,14 @@ class Dalai {
if (!this.queue) this.queue = []
if (platform === "win32") {
for(let i=0;i<msg.length; i++) {
console.log("msgi", msg[i]);
if (msg[i] === "\\") {
this.queueActive = true
// start pushing to buffer
// console.log("adding to queue", msg[i])
this.queue.push(msg[i]);
} else {
// otherwise flush
this.queue.push(msg[i])
console.log("flushing queue", this.queue)
let queueContent = this.queue.join("")
console.log({ before: queueContent, beforeEscape: winEscape(queueContent), after : this.htmlencode(winEscape(queueContent)) })

if (!this.bufferStarted && ["\n", "\b", "\f", "\r", "\t"].includes(queueContent)) {
// if the buffer hasn't started and incoming tokens are whitespaces, ignore
Expand All @@ -307,24 +303,13 @@ class Dalai {
}
} else {
if (req.html) {
cb(this.htmlencode(queueContent))
cb(this.htmlencode(msg))
} else {
cb(queueContent)
cb(msg)
}
}
}
async uninstall(core, ...models) {
// delete the rest of the files

//const files = (await fs.promises.readdir(path.resolve(this.home, core), { withFileTypes: true }))
// .filter(dirent => dirent.isFile() && !dirent.name.startsWith("."))
// .map(dirent => dirent.name);
//console.log("files", files)
//for(let file of files) {
// await fs.promises.rm(path.resolve(this.home, core, file)).catch((e) => { })
//}


if (models.length > 0) {
// delete the model folder
const modelsPath = path.resolve(this.home, core, "models")
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dalai",
"version": "0.2.52",
"version": "0.3.0",
"description": "",
"main": "index.js",
"author": "cocktailpeanut",
Expand Down

0 comments on commit 0404c33

Please sign in to comment.