From 6737668bcb0e1148512e24ce62bc4061f798c50c Mon Sep 17 00:00:00 2001 From: "Luna Magdalena :3" <3"@girlkissing.tips> Date: Fri, 16 Jan 2026 22:53:24 -0300 Subject: [PATCH] remove unused packages --- bg.yarn | 1 - cat.yarn | 1 - clear.yarn | 1 - cp.yarn | 1 - echo.yarn | 1 - env.yarn | 1 - info.yarn | 1 - kill.yarn | 1 - loader.yarn | 1 - ls.yarn | 1 - meta.yarn | 1 - mkdir.yarn | 1 - mv.yarn | 1 - plist.yarn | 1 - programs.yarn | 1 - rm.yarn | 1 - scroll.yarn | 1 - shutdown.yarn | 1 - slog.yarn | 1 - touch.yarn | 1 - yarn.yarn | 1 - 21 files changed, 21 deletions(-) delete mode 100644 bg.yarn delete mode 100644 cat.yarn delete mode 100644 clear.yarn delete mode 100644 cp.yarn delete mode 100644 echo.yarn delete mode 100644 env.yarn delete mode 100644 info.yarn delete mode 100644 kill.yarn delete mode 100644 loader.yarn delete mode 100644 ls.yarn delete mode 100644 meta.yarn delete mode 100644 mkdir.yarn delete mode 100644 mv.yarn delete mode 100644 plist.yarn delete mode 100644 programs.yarn delete mode 100644 rm.yarn delete mode 100644 scroll.yarn delete mode 100644 shutdown.yarn delete mode 100644 slog.yarn delete mode 100644 touch.yarn delete mode 100644 yarn.yarn diff --git a/bg.yarn b/bg.yarn deleted file mode 100644 index 79f55ca..0000000 --- a/bg.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"bg","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"bg.js":"%B/bg.js"}},"content":"{\"bg.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!args[0]) {\\n display.print(\\\"No program specified\\\", 0x1000)\\n quit()\\n}\\n\\nconst programName = args[0]\\nargs.splice(0, 1)\\n\\ntry {\\n exec.runProgram(programName, args)\\n} catch (e) {\\n if (e[0]) {\\n io.log(e)\\n }\\n}\\n\\nquit()\"}}"} \ No newline at end of file diff --git a/cat.yarn b/cat.yarn deleted file mode 100644 index 3142329..0000000 --- a/cat.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"cat","author":"Luna Magdalena :3","version":[1,1],"dependencies":[],"paths":{"cat.js":"%B/cat.js"}},"content":"{\"cat.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"program.autoOutput = false\\n\\nfor (let a of args) {\\n let file\\n try {\\n file = io.open(a)\\n } catch (e) {\\n display.print(\\\"Cannot open file\\\", 0x9000)\\n }\\n if (file) {\\n const lines = file.lines()\\n for (let line of lines) {\\n line = line.replace(/%/g, \\\"%%\\\")\\n io.output(\\\"\\\\n\\\" + line)\\n display.print(line, itty.baseStyle, false)\\n }\\n }\\n}\\n \\nquit()\"}}"} \ No newline at end of file diff --git a/clear.yarn b/clear.yarn deleted file mode 100644 index cf3e1df..0000000 --- a/clear.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"clear","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"clear.js":"%B/clear.js"}},"content":"{\"clear.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"display.clear(); quit()\"}}"} \ No newline at end of file diff --git a/cp.yarn b/cp.yarn deleted file mode 100644 index 5dda7e0..0000000 --- a/cp.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"cp","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"cp.js":"%B/cp.js"}},"content":"{\"cp.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!args[0] && !args[1]) {\\n itty.display.print(\\\"Not enough arguments\\\", 0xf000)\\n quit()\\n}\\n\\ntry {\\n itty.fs.copyNode(args[0], args[1])\\n} catch (e) {\\n itty.display.print(e[1] || \\\"Error copying node\\\", 0x9000)\\n}\\n\\nquit()\"}}"} \ No newline at end of file diff --git a/echo.yarn b/echo.yarn deleted file mode 100644 index e17d900..0000000 --- a/echo.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"echo","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"echo.js":"%B/echo.js"}},"content":"{\"echo.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"let echo = pipe\\nif (!pipe)\\n echo = args.join(\\\" \\\")\\n\\ndisplay.print(echo, itty.baseStyle, false)\\nquit()\"}}"} \ No newline at end of file diff --git a/env.yarn b/env.yarn deleted file mode 100644 index 78d30da..0000000 --- a/env.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"env","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"env.js":"%B/env.js"}},"content":"{\"env.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"const subcommand = args[0]\\nconst env = args[1]\\n\\nconst envtype = typeof itty.env[env]\\nlet value\\n\\nlet listing = false\\nlet listIndex = 0\\n\\nswitch(subcommand) {\\n case \\\"get\\\":\\n if (!env) {\\n display.print(\\\"No variable specified\\\")\\n quit()\\n }\\n display.print(JSON.stringify(itty.env[env]), getEnvStyle(envtype))\\n quit()\\n break\\n case \\\"set\\\":\\n if (!env) {\\n display.print(\\\"No variable specified\\\")\\n quit()\\n }\\n await parseValue()\\n if (itty.env[env] && typeof itty.env[env] !== typeof value) {\\n let r = await io.read(\\\"Mismatch between env type and provided value type. Continue? [y/N]: \\\")\\n if (r.length === 0 || r[0].toLowerCase() !== \\\"y\\\") {\\n display.print(\\\"Aborting...\\\")\\n quit()\\n }\\n }\\n itty.env[env] = value\\n quit()\\n break\\n case \\\"list\\\":\\n if (Object.keys(itty.env).length < itty.height - 4) {\\n for (let e in itty.env) {\\n display.buffer(e, getEnvStyle(typeof itty.env[e]))\\n display.buffer(\\\" = \\\", 0xe000)\\n display.print(JSON.stringify(itty.env[e]).replaceAll(\\\"%\\\", \\\"%%\\\"))\\n }\\n display.render()\\n quit()\\n } else {\\n program.enterFullscreen()\\n listing = true\\n onInput(\\\"\\\", {})\\n }\\n}\\n\\nfunction onInput(k) {\\n if (!listing)\\n return\\n\\n switch (k) {\\n case \\\"%^\\\":\\n listIndex = Math.max(listIndex - 1, 0)\\n break\\n case \\\"%v\\\":\\n listIndex = Math.min(listIndex + 1, Object.keys(itty.env).length - 1)\\n break\\n case \\\"%e\\\":\\n display.clear()\\n quit()\\n }\\n\\n display.clear()\\n for (let i = listIndex; i < itty.height - 1 + listIndex; i++) {\\n const e = Object.keys(itty.env)[i]\\n if (!e)\\n break\\n\\n display.buffer(e, getEnvStyle(typeof itty.env[e]))\\n display.buffer(\\\" = \\\", 0xe000)\\n display.buffer(JSON.stringify(itty.env[e]) + \\\"%n\\\")\\n }\\n itty.cursorY = itty.height - 1\\n display.write(\\\"Arrow Up/Down to scroll, Escape to quit\\\")\\n}\\n\\nasync function parseValue() {\\n let v = await io.read([[\\\"Value: \\\", 0xe000]])\\n v = v.replaceAll(\\\"%%\\\", \\\"%\\\")\\n\\n try {\\n v = JSON.parse(v)\\n } catch (e) {\\n try {\\n v = JSON.parse('\\\"' + v + '\\\"')\\n } catch (e) {\\n throw [1, \\\"Cannot parse value\\\"]\\n }\\n }\\n value = v\\n}\\n \\nfunction getEnvStyle(type) {\\n let style = 0xf000\\n switch(type) {\\n case \\\"object\\\":\\n style = 0x4000\\n break\\n case \\\"string\\\":\\n style = 0x6000\\n break\\n case \\\"number\\\":\\n style = 0x5000\\n break\\n case \\\"boolean\\\":\\n style = 0xa000\\n break\\n }\\n return style\\n}\\n\\nquit()\"}}"} \ No newline at end of file diff --git a/info.yarn b/info.yarn deleted file mode 100644 index ae2c2ad..0000000 --- a/info.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"info","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"info.js":"%B/info.js"}},"content":"{\"info.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"display.buffer(`Itty version: v${itty.version[0]}.${itty.version[1]}${itty.version[2] ? \\\".\\\" + itty.version[2] : \\\"\\\"} ${itty.version[3] || \\\"\\\"}%nRoot FS: ${itty.disk.version}`, 0x4000)\\ndisplay.buffer(\\\"%n%nDisplay dimensions: \\\", 0x7000)\\ndisplay.buffer(itty.width + \\\"x\\\" + itty.height + \\\"%n%n\\\", 0x6000)\\nfor (let i=0; i < 8; i++) {\\n display.buffer(\\\" \\\", 0x0100 * i)\\n}\\nitty.cursorY++\\nitty.cursorX = 0\\nfor (let i=8; i < 16; i++) {\\n display.buffer(\\\" \\\", 0x0100 * i)\\n}\\n\\ndisplay.buffer(\\\"%n%nITTY: Incredibly Tiny Terminal, Yay!\\\", 0x4041)\\ndisplay.buffer(\\\" by \\\", 0x7041)\\ndisplay.buffer(\\\"Magdalunaa\\\", 0x6051)\\nstyle.setAttribute(1, {_link: \\\"https://codeberg.org/Magdalunaa/itty\\\", style: \\\"cursor: pointer; text-decoration-color: var(--itty-c-4)\\\"})\\ndisplay.render()\\nquit()\"}}"} \ No newline at end of file diff --git a/kill.yarn b/kill.yarn deleted file mode 100644 index 4f69db2..0000000 --- a/kill.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"kill","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"kill.js":"%B/kill.js"}},"content":"{\"kill.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"const id = Number(args[0])\\n\\nif (id)\\n try {\\n exec.quit(id)\\n } catch {}\\nquit()\"}}"} \ No newline at end of file diff --git a/loader.yarn b/loader.yarn deleted file mode 100644 index 980f9ec..0000000 --- a/loader.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"loader","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"loader.js":"%B/loader.js"}},"content":"{\"loader.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!args[1]) {\\n display.print(\\\"Not enough arguments\\\")\\n quit()\\n}\\n\\nconst command = args[0]\\nargs.splice(0, 1)\\nconst mountpoint = args.join(\\\" \\\")\\nconst node = fs.getNode(mountpoint)\\nlet content\\n\\nswitch(command) {\\n case \\\"save\\\":\\n case \\\"download\\\":\\n content = fs.export(node)\\n\\n const blob = new Blob([content], { type: \\\"text/plain\\\" })\\n const url = URL.createObjectURL(blob)\\n\\n const a = document.createElement(\\\"a\\\")\\n a.href = url\\n a.download = node.name\\n a.style.display = \\\"none\\\"\\n\\n document.body.appendChild(a)\\n a.click()\\n document.body.removeChild(a)\\n\\n URL.revokeObjectURL(url)\\n break\\n case \\\"load\\\":\\n case \\\"upload\\\":\\n content = await getFile()\\n await fs.import(content.text, mountpoint)\\n display.print(\\\"Disk loaded successfully\\\", 0x3000)\\n}\\n\\nquit()\\n\\nfunction getFile() {\\n return new Promise(resolve => {\\n const input = document.createElement(\\\"input\\\")\\n input.type = \\\"file\\\"\\n input.accept = \\\"*/*\\\"\\n input.style.display = \\\"none\\\"\\n\\n document.body.appendChild(input)\\n\\n input.onchange = async () => {\\n const file = input.files[0]\\n const text = await file.text();\\n document.body.removeChild(input)\\n resolve({ file, text })\\n }\\n\\n input.click()\\n })\\n}\"}}"} \ No newline at end of file diff --git a/ls.yarn b/ls.yarn deleted file mode 100644 index a8ff0f1..0000000 --- a/ls.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"ls","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"ls.js":"%B/ls.js"}},"content":"{\"ls.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"// get flags\\nlet flags = {}\\nlet dir = \\\".\\\"\\nfor (let i=0; i < args.length; i++) {\\n if (args[i][0] === \\\"-\\\") {\\n if (args[i].indexOf(\\\"l\\\") !== -1)\\n flags.l = true\\n if (args[i].indexOf(\\\"a\\\") !== -1)\\n flags.a = true\\n } else {\\n dir = args[i]\\n break\\n }\\n}\\n\\n// get node\\nlet node\\ntry {\\n node = fs.getNode(dir)\\n} catch (e) {\\n display.print(\\\"Not a directory\\\")\\n quit()\\n}\\n\\nif (!node || node.mode !== \\\"d\\\") {\\n display.print(\\\"Not a directory\\\")\\n quit()\\n}\\n\\nlet empty = true\\nfor (let n of fs.listDir(node)) {\\n if (n.name[0] === \\\".\\\" && !flags.a)\\n continue\\n\\n empty = false\\n\\n let style = 0x7000\\n if (n.mode === \\\"d\\\")\\n style = 0x5000\\n\\n if (n.protected)\\n style += 0x0020\\n\\n if (itty.cursorX + n.name.length >= itty.width) {\\n itty.cursorX = 0\\n itty.cursorY++\\n }\\n\\n while (itty.cursorY >= itty.height)\\n display.lift()\\n\\n if (!flags.l) {\\n display.buffer(n.name + \\\" \\\", style)\\n } else {\\n display.buffer(n.mode + \\\" \\\", 0xc000)\\n display.buffer(n.name, style)\\n display.buffer(n.protected ? \\\" (protected)%n\\\" : \\\"%n\\\", 0xf000)\\n }\\n}\\n\\nif (empty)\\n display.print(\\\"Directory is empty\\\", 0xf000)\\n\\ndisplay.render()\\nquit()\"}}"} \ No newline at end of file diff --git a/meta.yarn b/meta.yarn deleted file mode 100644 index 9f767b1..0000000 --- a/meta.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"meta","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"meta.js":"%B/meta.js"}},"content":"{\"meta.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"const file = fs.getNode(args[1])\\nconst meta = file.metadata\\n\\nif (!file) {\\n display.print(\\\"File not found\\\", 0x1000)\\n quit()\\n}\\n\\nconst subcommand = args[0]\\nconst key = args[2]\\n\\nlet value\\n\\nlet listing = false\\nlet listIndex = 0\\n\\nswitch(subcommand) {\\n case \\\"get\\\":\\n if (!key) {\\n display.print(\\\"No variable specified\\\")\\n quit()\\n }\\n display.print(JSON.stringify(meta[key]), getStyle(typeof meta[key]))\\n quit()\\n break\\n case \\\"set\\\":\\n if (!key) {\\n display.print(\\\"No variable specified\\\")\\n quit()\\n }\\n await parseValue()\\n try {\\n fs.setMetadata(file, key, value)\\n } catch (e) {\\n display.print(\\\"Error setting metadata: \\\" + e[1], 0x1000)\\n }\\n quit()\\n break\\n case \\\"list\\\":\\n for (let e in meta) {\\n display.buffer(e, getStyle(typeof meta[e]))\\n display.buffer(\\\" = \\\", 0xe000)\\n display.print(JSON.stringify(meta[e]).replaceAll(\\\"%\\\", \\\"%%\\\"))\\n }\\n display.render()\\n quit()\\n}\\n \\nfunction getStyle(type) {\\n let style = 0xf000\\n switch(type) {\\n case \\\"object\\\":\\n style = 0x4000\\n break\\n case \\\"string\\\":\\n style = 0x6000\\n break\\n case \\\"number\\\":\\n style = 0x5000\\n break\\n case \\\"boolean\\\":\\n style = 0xa000\\n break\\n }\\n return style\\n}\\n\\nquit()\"}}"} \ No newline at end of file diff --git a/mkdir.yarn b/mkdir.yarn deleted file mode 100644 index 4b58a19..0000000 --- a/mkdir.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"mkdir","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"mkdir.js":"%B/mkdir.js"}},"content":"{\"mkdir.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!args[0]) {\\n display.print(\\\"No path provided\\\", 0xf000)\\n quit()\\n}\\n\\ntry {\\n fs.makeDir(args[0])\\n} catch (e) {\\n display.print(\\\"Error creating directory\\\", 0x1000)\\n}\\nquit()\"}}"} \ No newline at end of file diff --git a/mv.yarn b/mv.yarn deleted file mode 100644 index eadbccd..0000000 --- a/mv.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"mv","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"mv.js":"%B/mv.js"}},"content":"{\"mv.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!args[0] && !args[1]) {\\n display.print(\\\"Not enough arguments\\\", 0xf000)\\n quit()\\n}\\n\\ntry {\\n fs.moveNode(args[0], args[1])\\n} catch (e) {\\n display.print(e[1] || \\\"Error moving node\\\", 0x9000)\\n}\\n\\nquit()\"}}"} \ No newline at end of file diff --git a/plist.yarn b/plist.yarn deleted file mode 100644 index 1dea110..0000000 --- a/plist.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name": "plist", "author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"plist.js":"%B/plist.js"}},"content":"{\"plist.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"// iterate over itty.program\\n\\nconst programList = exec.listPrograms()\\nfor (let p of programList) {\\n if (!p)\\n continue\\n display.buffer(\\\"[\\\", 0xf000)\\n display.buffer(p.id, 0x6000)\\n display.buffer(\\\"] (\\\", 0xf000)\\n display.buffer(p.uid, 0x4000)\\n display.buffer(\\\")%t\\\", 0xf000)\\n display.buffer(p.name, 0xe000)\\n if (p.background) {\\n display.buffer(\\\"%t(\\\", 0xf000)\\n display.buffer(\\\"background\\\", 0x5000)\\n display.buffer(\\\")\\\", 0xf000)\\n }\\n display.write(\\\"%n\\\")\\n}\\n\\nquit()\"}}"} \ No newline at end of file diff --git a/programs.yarn b/programs.yarn deleted file mode 100644 index 9c4642a..0000000 --- a/programs.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"programs","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"programs.js":"%B/programs.js"}},"content":"{\"programs.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"for (let path of itty.env.path) {\\n path = fs.listDir(path)\\n for (let p in path) {\\n p = path[p]\\n if (p.ext === \\\"js\\\") {\\n const name = p.name.slice(0, -3)\\n if (itty.cursorX + name.length >= itty.width) {\\n itty.cursorX = 0\\n itty.cursorY++\\n }\\n while (itty.cursorY >= itty.height)\\n display.lift()\\n display.buffer(name + \\\" \\\")\\n }\\n }\\n}\\n \\ndisplay.render()\\nquit()\"}}"} \ No newline at end of file diff --git a/rm.yarn b/rm.yarn deleted file mode 100644 index 710fb35..0000000 --- a/rm.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"rm","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"rm.js":"%B/rm.js"}},"content":"{\"rm.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!args[0]) {\\n display.print(\\\"No path provided\\\", 0xf000)\\n quit()\\n}\\n\\ntry {\\n fs.removeNode(args[0])\\n} catch (e) {\\n display.print(e[1] || \\\"Error removing node\\\", 0x9000)\\n}\\n\\nquit()\"}}"} \ No newline at end of file diff --git a/scroll.yarn b/scroll.yarn deleted file mode 100644 index 7ad6191..0000000 --- a/scroll.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"scroll","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"scroll.js":"%B/scroll.js"}},"content":"{\"scroll.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!pipe)\\n quit()\\n\\nprogram.enterFullscreen()\\n\\nconst lines = pipe.split(\\\"\\\\n\\\")\\n\\nfunction renderLines() {\\n display.clear()\\n for (let i = start; i < lines.length; i++) {\\n if (lines[i].length / itty.width > itty.height - itty.cursorY) {\\n for (let x = 0; x < Math.floor(lines[i].length / itty.width); x++)\\n display.lift()\\n break\\n }\\n display.print(lines[i] || \\\" \\\", undefined, false)\\n }\\n}\\n\\nlet start = 0\\nrenderLines()\\n\\nfunction onInput(k) {\\n switch (k) {\\n case \\\"%^\\\":\\n start = Math.max(start - 1, 0)\\n renderLines()\\n break\\n case \\\"%v\\\":\\n start = Math.min(start + 1, lines.length - 1)\\n renderLines()\\n break\\n case \\\"%e\\\":\\n case \\\"q\\\":\\n quit()\\n }\\n}\\n\\nfunction onQuit() {\\n display.clear()\\n}\"}}"} \ No newline at end of file diff --git a/shutdown.yarn b/shutdown.yarn deleted file mode 100644 index 7ecd0a2..0000000 --- a/shutdown.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"shutdown","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"shutdown.js":"%B/shutdown.js"}},"content":"{\"shutdown.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"exec.shutdown(); quit()\"}}"} \ No newline at end of file diff --git a/slog.yarn b/slog.yarn deleted file mode 100644 index fbc6a78..0000000 --- a/slog.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"slog","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"slog.js":"%B/slog.js"}},"content":"{\"slog.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"// ensure log file exists\\n\\nlet logfile\\n\\ntry {\\n logfile = io.open(\\\"/itty/slog\\\", \\\"a\\\")\\n} catch {}\\n\\nif (!logfile) {\\n fs.getNode(\\\"/itty/\\\").content[\\\"slog\\\"] = {\\n protected: false,\\n mode: \\\"f\\\",\\n content: \\\"\\\",\\n parent: fs.getNode(\\\"/itty/\\\"),\\n name: \\\"slog\\\",\\n js: \\\"\\\",\\n metadata: {}\\n }\\n logfile = io.open(\\\"/itty/slog\\\", \\\"a\\\")\\n}\\n\\nconst message = JSON.parse(pipe)\\n\\nif (message[1][0] !== 0)\\n console.log(\\\"ERROR\\\", message[1])\\n\\nlogfile.print(`(${message[0].id}/${message[0].uid}) ${message[0].name}: [${message[1][0] || \\\"INFO\\\"}] ${message[1][1]}`)\\nlogfile.writeOut()\\n\\nquit()\"}}"} \ No newline at end of file diff --git a/touch.yarn b/touch.yarn deleted file mode 100644 index ecce0b2..0000000 --- a/touch.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"touch","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"touch.js":"%B/touch.js"}},"content":"{\"touch.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"if (!args[0]) {\\n display.print(\\\"No path provided\\\", 0xf000)\\n quit()\\n}\\n\\ntry {\\n fs.makeNode(args[0], \\\"f\\\")\\n} catch (e) {\\n switch (e[0]) {\\n case 1:\\n display.print(\\\"File already exists\\\", 0xf000)\\n break\\n case 3:\\n display.print(\\\"Parent directory is protected\\\", 0x9000)\\n break\\n case 10:\\n display.print(\\\"Parent directory does not exist\\\", 0x9000)\\n break\\n default:\\n display.print(\\\"Error creating file\\\", 0x9000)\\n }\\n}\\nquit()\"}}"} \ No newline at end of file diff --git a/yarn.yarn b/yarn.yarn deleted file mode 100644 index 006b2d8..0000000 --- a/yarn.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"yarn","author":"Luna Magdalena :3","version":[1],"dependencies":[],"paths":{"yarn.js":"%B/yarn.js"}},"content":"{\"yarn.js\":{\"protected\":true,\"metadata\":{\"runner\":[]},\"mode\":\"f\",\"content\":\"function spool(nodes) {\\n const yarnball = {}\\n\\n for (let node of nodes) {\\n let n\\n try {\\n n = fs.getNode(node)\\n } catch {\\n continue\\n }\\n\\n yarnball[n.name] = n\\n }\\n\\n return JSON.stringify(yarnball, (key, value) => {if (key === \\\"parent\\\" || key === \\\"name\\\" || key === \\\"ext\\\") {return undefined}; return value})\\n}\\n\\nfunction unspool(yarnball, path) {\\n fs.makeDir(path)\\n const node = fs.getNode(path)\\n if (node.protected)\\n io.error([3, \\\"Destination is protected\\\"])\\n\\n try {\\n yarnball = JSON.parse(yarnball)\\n } catch {\\n io.error([5, \\\"Cannot parse yarnball\\\"])\\n }\\n\\n for (let file of Object.keys(yarnball)) {\\n if (node.content[file])\\n continue\\n const obj = yarnball[file]\\n node.content[file] = obj\\n }\\n fs.refreshPathAttributes(node)\\n}\\n\\nlet yarnfile\\nlet meta\\nlet jsonfile\\n\\nswitch (args[0]) {\\n case \\\"spool\\\":\\n yarnfile = io.open(args[1], \\\"w\\\")\\n yarnfile.write(spool(args.slice(2)))\\n yarnfile.writeOut()\\n break\\n case \\\"unspool\\\":\\n yarnfile = io.open(args[1], \\\"r\\\")\\n unspool(yarnfile.read(), args[2])\\n break\\n case \\\"get-metadata\\\":\\n yarnfile = io.open(args[1], \\\"r\\\")\\n if (args[2])\\n display.print(JSON.stringify(fs.getMetadata(yarnfile, args[2])))\\n else\\n for (let m of Object.keys(yarnfile.metadata))\\n display.print(m + \\\": \\\" + JSON.stringify(fs.getMetadata(yarnfile, m)))\\n break\\n case \\\"set-metadata\\\":\\n yarnfile = fs.getNode(args[1])\\n meta = await io.read()\\n fs.setMetadata(yarnfile, args[2], meta)\\n break\\n case \\\"metadata-from-json\\\":\\n try {\\n yarnfile = fs.getNode(args[1])\\n } catch {\\n io.error([1, \\\"Cannot find yarnball\\\"])\\n }\\n if (yarnfile.protected)\\n io.error([2, \\\"Yarnball is protected\\\"])\\n\\n try {\\n jsonfile = fs.getNode(args[2])\\n } catch {\\n io.error([1, \\\"Cannot find JSON file\\\"])\\n }\\n\\n try {\\n meta = JSON.parse(jsonfile.content)\\n } catch {\\n io.error([6, \\\"Cannot parse JSON\\\"])\\n }\\n\\n yarnfile.metadata = meta\\n break\\n}\\nquit()\"}}"} \ No newline at end of file