@prozilla-os/terminal 1.1.7 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cat-BhP4PEUK.js → chunks/cat-DzV_0CUU.js} +2 -2
- package/dist/chunks/cat-DzV_0CUU.js.map +1 -0
- package/dist/chunks/cd-ByDAWGKF.js +16 -0
- package/dist/chunks/cd-ByDAWGKF.js.map +1 -0
- package/dist/chunks/clear-DtYBxmDr.js.map +1 -0
- package/dist/{cmatrix-BRnwuwpQ.js → chunks/cmatrix-Idv6FCk5.js} +2 -2
- package/dist/chunks/cmatrix-Idv6FCk5.js.map +1 -0
- package/dist/chunks/command-nBL1aO7T.js.map +1 -0
- package/dist/{compgen-DwiJvEym.js → chunks/compgen-DL1gfdlf.js} +2 -2
- package/dist/chunks/compgen-DL1gfdlf.js.map +1 -0
- package/dist/{cowsay-BzvDA7zo.js → chunks/cowsay-CnfiY6_H.js} +2 -2
- package/dist/chunks/cowsay-CnfiY6_H.js.map +1 -0
- package/dist/chunks/dir-BlrznBqV.js.map +1 -0
- package/dist/chunks/echo-PyZ6XYF6.js.map +1 -0
- package/dist/chunks/eval-CnKC-mrj.js.map +1 -0
- package/dist/chunks/exit-CizX3N_u.js.map +1 -0
- package/dist/chunks/fortune-Cs0PtMgs.js.map +1 -0
- package/dist/{help-VUVj2BCL.js → chunks/help-CVuRqwjT.js} +2 -2
- package/dist/chunks/help-CVuRqwjT.js.map +1 -0
- package/dist/chunks/hostname-BBOQWx6L.js.map +1 -0
- package/dist/{lolcat-Bqd7OWmj.js → chunks/lolcat-COIxoNFB.js} +2 -2
- package/dist/chunks/lolcat-COIxoNFB.js.map +1 -0
- package/dist/{ls-CVAvyBf2.js → chunks/ls-CDe60u5v.js} +2 -2
- package/dist/chunks/ls-CDe60u5v.js.map +1 -0
- package/dist/{main-BXcuHQUl.js → chunks/main-ieLHBWKy.js} +84 -83
- package/dist/chunks/main-ieLHBWKy.js.map +1 -0
- package/dist/{make-CQIuK3XA.js → chunks/make-BIp0siBJ.js} +2 -2
- package/dist/chunks/make-BIp0siBJ.js.map +1 -0
- package/dist/{man-Biyz7eHc.js → chunks/man-BhyrCkvm.js} +2 -2
- package/dist/chunks/man-BhyrCkvm.js.map +1 -0
- package/dist/chunks/mkdir-BTSAC1PK.js.map +1 -0
- package/dist/{neofetch-D9o1v0O_.js → chunks/neofetch-DDgAqQZC.js} +4 -4
- package/dist/chunks/neofetch-DDgAqQZC.js.map +1 -0
- package/dist/chunks/pwd-CSapfDtw.js.map +1 -0
- package/dist/chunks/reboot-Bwxhoa8q.js.map +1 -0
- package/dist/{reload-BSgEb-oK.js → chunks/reload-Dy-4yWsY.js} +2 -2
- package/dist/chunks/reload-Dy-4yWsY.js.map +1 -0
- package/dist/chunks/rev-C8qQIyj_.js.map +1 -0
- package/dist/{rm-BhPcaHUP.js → chunks/rm-BssAo3hK.js} +2 -2
- package/dist/chunks/rm-BssAo3hK.js.map +1 -0
- package/dist/{rmdir-BkW-AaKz.js → chunks/rmdir-iKWxmkTT.js} +2 -2
- package/dist/chunks/rmdir-iKWxmkTT.js.map +1 -0
- package/dist/{sl-CMPnMUfC.js → chunks/sl-BbE5ahZH.js} +2 -2
- package/dist/chunks/sl-BbE5ahZH.js.map +1 -0
- package/dist/{touch-BT9BnHkj.js → chunks/touch-DP1jSzBq.js} +2 -2
- package/dist/chunks/touch-DP1jSzBq.js.map +1 -0
- package/dist/chunks/uptime-BYmCcOUM.js.map +1 -0
- package/dist/{whatis-CR54hDa_.js → chunks/whatis-Dd0ZBHZz.js} +2 -2
- package/dist/chunks/whatis-Dd0ZBHZz.js.map +1 -0
- package/dist/chunks/whoami-CQNGmqxL.js.map +1 -0
- package/dist/main.js +2 -1
- package/package.json +4 -4
- package/dist/assets/main.css +0 -1
- package/dist/cat-BhP4PEUK.js.map +0 -1
- package/dist/cd-Dm40ypzX.js +0 -14
- package/dist/cd-Dm40ypzX.js.map +0 -1
- package/dist/clear-DtYBxmDr.js.map +0 -1
- package/dist/cmatrix-BRnwuwpQ.js.map +0 -1
- package/dist/command-nBL1aO7T.js.map +0 -1
- package/dist/compgen-DwiJvEym.js.map +0 -1
- package/dist/cowsay-BzvDA7zo.js.map +0 -1
- package/dist/dir-BlrznBqV.js.map +0 -1
- package/dist/echo-PyZ6XYF6.js.map +0 -1
- package/dist/eval-CnKC-mrj.js.map +0 -1
- package/dist/exit-CizX3N_u.js.map +0 -1
- package/dist/fortune-Cs0PtMgs.js.map +0 -1
- package/dist/help-VUVj2BCL.js.map +0 -1
- package/dist/hostname-BBOQWx6L.js.map +0 -1
- package/dist/lolcat-Bqd7OWmj.js.map +0 -1
- package/dist/ls-CVAvyBf2.js.map +0 -1
- package/dist/main-BXcuHQUl.js.map +0 -1
- package/dist/make-CQIuK3XA.js.map +0 -1
- package/dist/man-Biyz7eHc.js.map +0 -1
- package/dist/mkdir-BTSAC1PK.js.map +0 -1
- package/dist/neofetch-D9o1v0O_.js.map +0 -1
- package/dist/pwd-CSapfDtw.js.map +0 -1
- package/dist/reboot-Bwxhoa8q.js.map +0 -1
- package/dist/reload-BSgEb-oK.js.map +0 -1
- package/dist/rev-C8qQIyj_.js.map +0 -1
- package/dist/rm-BhPcaHUP.js.map +0 -1
- package/dist/rmdir-BkW-AaKz.js.map +0 -1
- package/dist/sl-CMPnMUfC.js.map +0 -1
- package/dist/touch-BT9BnHkj.js.map +0 -1
- package/dist/uptime-BYmCcOUM.js.map +0 -1
- package/dist/whatis-CR54hDa_.js.map +0 -1
- package/dist/whoami-CQNGmqxL.js.map +0 -1
- /package/dist/{clear-DtYBxmDr.js → chunks/clear-DtYBxmDr.js} +0 -0
- /package/dist/{command-nBL1aO7T.js → chunks/command-nBL1aO7T.js} +0 -0
- /package/dist/{dir-BlrznBqV.js → chunks/dir-BlrznBqV.js} +0 -0
- /package/dist/{echo-PyZ6XYF6.js → chunks/echo-PyZ6XYF6.js} +0 -0
- /package/dist/{eval-CnKC-mrj.js → chunks/eval-CnKC-mrj.js} +0 -0
- /package/dist/{exit-CizX3N_u.js → chunks/exit-CizX3N_u.js} +0 -0
- /package/dist/{fortune-Cs0PtMgs.js → chunks/fortune-Cs0PtMgs.js} +0 -0
- /package/dist/{history-l0sNRNKZ.js → chunks/history-l0sNRNKZ.js} +0 -0
- /package/dist/{history-l0sNRNKZ.js.map → chunks/history-l0sNRNKZ.js.map} +0 -0
- /package/dist/{hostname-BBOQWx6L.js → chunks/hostname-BBOQWx6L.js} +0 -0
- /package/dist/{mkdir-BTSAC1PK.js → chunks/mkdir-BTSAC1PK.js} +0 -0
- /package/dist/{pwd-CSapfDtw.js → chunks/pwd-CSapfDtw.js} +0 -0
- /package/dist/{reboot-Bwxhoa8q.js → chunks/reboot-Bwxhoa8q.js} +0 -0
- /package/dist/{rev-C8qQIyj_.js → chunks/rev-C8qQIyj_.js} +0 -0
- /package/dist/{uptime-BYmCcOUM.js → chunks/uptime-BYmCcOUM.js} +0 -0
- /package/dist/{whoami-CQNGmqxL.js → chunks/whoami-CQNGmqxL.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ANSI as o } from "@prozilla-os/shared";
|
|
2
|
-
import { C as c, f } from "./main-
|
|
2
|
+
import { C as c, f } from "./main-ieLHBWKy.js";
|
|
3
3
|
import { C as d } from "./command-nBL1aO7T.js";
|
|
4
4
|
const g = 5, C = new d().setRequireArgs(!0).setManual({
|
|
5
5
|
purpose: "Show system reference manuals",
|
|
@@ -45,4 +45,4 @@ The manual page associated with this command is then found and displayed.`,
|
|
|
45
45
|
export {
|
|
46
46
|
C as man
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=man-
|
|
48
|
+
//# sourceMappingURL=man-BhyrCkvm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"man-BhyrCkvm.js","sources":["../../src/core/commands/man.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nconst MARGIN = 5;\n\nexport const man = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Show system reference manuals\",\n\t\tusage: \"man [options] page\\n\"\n\t\t\t+ \"man -k [options] regexp\",\n\t\tdescription: \"Each page arguments given to man is normally the name of a command.\\n\"\n\t\t\t+ \"The manual page associated with this command is then found and displayed.\",\n\t\toptions: {\n\t\t\t\"-k\": \"Search for manual page using regexp\",\n\t\t},\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { options } = params as ExecuteParams;\n\n\t\t// Search function\n\t\tif (options?.includes(\"k\")) {\n\t\t\tconst commands = CommandsManager.search((args as string[])[0].toLowerCase());\n\t\t\treturn commands.map((command) => {\n\t\t\t\tif (command.manual?.purpose) {\n\t\t\t\t\treturn `${command.name} - ${command.manual.purpose}`;\n\t\t\t\t} else {\n\t\t\t\t\treturn command.name;\n\t\t\t\t}\n\t\t\t}).sort().join(\"\\n\");\n\t\t}\n\n\t\tconst commandName = (args as string[])[0].toLowerCase();\n\t\tconst command = CommandsManager.find(commandName);\n\n\t\tif (!command)\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\n\n\t\tconst manual = command.manual;\n\n\t\tif (!manual)\n\t\t\treturn formatError(this.name, `${commandName}: No manual found`);\n\n\t\tconst formatText = (text: string) => {\n\t\t\tconst lines = text.split(\"\\n\").map((line) => \" \".repeat(MARGIN) + line);\n\t\t\treturn lines.join(\"\\n\");\n\t\t};\n\n\t\tconst sections = [[\"NAME\"]];\n\n\t\tif (manual.purpose) {\n\t\t\tsections[0].push(formatText(`${commandName} - ${ANSI.decoration.dim}${ANSI.fg.yellow}${manual.purpose}${ANSI.reset}`));\n\t\t} else {\n\t\t\tsections[0].push(formatText(commandName));\n\t\t}\n\n\t\tif (manual.usage) {\n\t\t\tsections.push([\n\t\t\t\t\"SYNOPSIS\",\n\t\t\t\tformatText(manual.usage),\n\t\t\t]);\n\t\t}\n\t\t\n\t\tif (manual.description) {\n\t\t\tsections.push([\n\t\t\t\t\"DESCRIPTION\",\n\t\t\t\tformatText(manual.description),\n\t\t\t]);\n\t\t}\n\n\t\tif (manual.options) {\n\t\t\tsections.push([\n\t\t\t\t\"OPTIONS\",\n\t\t\t\tformatText(Object.entries(manual.options).map(([key, value]) => {\n\t\t\t\t\treturn `${key} ${ANSI.decoration.dim}${ANSI.fg.yellow}${value}${ANSI.reset}`;\n\t\t\t\t}).join(\"\\n\")),\n\t\t\t]);\n\t\t}\n\n\t\treturn sections.map((section) => {\n\t\t\tsection[0] = ANSI.fg.yellow + section[0] + ANSI.reset;\n\t\t\treturn section.join(\"\\n\");\n\t\t}).join(\"\\n\\n\");\n\t});"],"names":["MARGIN","man","Command","args","params","options","CommandsManager","command","commandName","formatError","manual","formatText","text","line","sections","ANSI","key","value","section"],"mappings":";;;AAKA,MAAMA,IAAS,GAEFC,IAAM,IAAIC,IACrB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA;AAAA,EAEP,aAAa;AAAA;AAAA,EAEb,SAAS;AAAA,IACR,MAAM;AAAA,EACP;AACD,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,SAAAC,EAAY,IAAAD;AAGhB,MAAAC,KAAA,QAAAA,EAAS,SAAS;AAEd,WADUC,EAAgB,OAAQH,EAAkB,CAAC,EAAE,aAAa,EAC3D,IAAI,CAACI,MAAY;;AAC5BA,cAAAA,IAAAA,EAAQ,WAARA,QAAAA,EAAgB,UACX,GAAGA,EAAQ,IAAI,MAAMA,EAAQ,OAAO,OAAO,KAE5CA,EAAQ;AAAA,IAEhB,CAAA,EAAE,KAAK,EAAE,KAAK;AAAA,CAAI;AAGpB,QAAMC,IAAeL,EAAkB,CAAC,EAAE,YAAY,GAChDI,IAAUD,EAAgB,KAAKE,CAAW;AAEhD,MAAI,CAACD;AACJ,WAAOE,EAAY,KAAK,MAAM,GAAGD,CAAW,qBAAqB;AAElE,QAAME,IAASH,EAAQ;AAEvB,MAAI,CAACG;AACJ,WAAOD,EAAY,KAAK,MAAM,GAAGD,CAAW,mBAAmB;AAE1D,QAAAG,IAAa,CAACC,MACLA,EAAK,MAAM;AAAA,CAAI,EAAE,IAAI,CAACC,MAAS,IAAI,OAAOb,CAAM,IAAIa,CAAI,EACzD,KAAK;AAAA,CAAI,GAGjBC,IAAW,CAAC,CAAC,MAAM,CAAC;AAE1B,SAAIJ,EAAO,UACDI,EAAA,CAAC,EAAE,KAAKH,EAAW,GAAGH,CAAW,MAAMO,EAAK,WAAW,GAAG,GAAGA,EAAK,GAAG,MAAM,GAAGL,EAAO,OAAO,GAAGK,EAAK,KAAK,EAAE,CAAC,IAErHD,EAAS,CAAC,EAAE,KAAKH,EAAWH,CAAW,CAAC,GAGrCE,EAAO,SACVI,EAAS,KAAK;AAAA,IACb;AAAA,IACAH,EAAWD,EAAO,KAAK;AAAA,EAAA,CACvB,GAGEA,EAAO,eACVI,EAAS,KAAK;AAAA,IACb;AAAA,IACAH,EAAWD,EAAO,WAAW;AAAA,EAAA,CAC7B,GAGEA,EAAO,WACVI,EAAS,KAAK;AAAA,IACb;AAAA,IACAH,EAAW,OAAO,QAAQD,EAAO,OAAO,EAAE,IAAI,CAAC,CAACM,GAAKC,CAAK,MAClD,GAAGD,CAAG,IAAID,EAAK,WAAW,GAAG,GAAGA,EAAK,GAAG,MAAM,GAAGE,CAAK,GAAGF,EAAK,KAAK,EAC1E,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA,EAAA,CACb,GAGKD,EAAS,IAAI,CAACI,OACZA,EAAA,CAAC,IAAIH,EAAK,GAAG,SAASG,EAAQ,CAAC,IAAIH,EAAK,OACzCG,EAAQ,KAAK;AAAA,CAAI,EACxB,EAAE,KAAK;AAAA;AAAA,CAAM;AACf,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mkdir-BTSAC1PK.js","sources":["../../src/core/commands/mkdir.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const mkdir = new Command()\n\t.setManual({\n\t\tpurpose: \"Create a directory\",\n\t})\n\t.setRequireArgs(true)\n\t.setExecute(function(args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\t\tconst name = (args as string[])[0];\n\t\n\t\tif (currentDirectory.findSubFolder(name))\n\t\t\treturn { blank: true };\n\t\n\t\tcurrentDirectory.createFolder(name);\n\t\treturn { blank: true };\n\t});"],"names":["mkdir","Command","args","params","currentDirectory","name"],"mappings":";AAEO,MAAMA,IAAQ,IAAIC,EAAQ,EAC/B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,eAAe,EAAI,EACnB,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAQH,EAAkB,CAAC;AAE7B,SAAAE,EAAiB,cAAcC,CAAI,IAC/B,EAAE,OAAO,QAEjBD,EAAiB,aAAaC,CAAI,GAC3B,EAAE,OAAO;AACjB,CAAC;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SettingsManager as S, THEMES as l } from "@prozilla-os/core";
|
|
2
2
|
import { ANSI as n } from "@prozilla-os/shared";
|
|
3
|
-
import { A as d, a as I } from "./main-
|
|
3
|
+
import { A as d, a as I } from "./main-ieLHBWKy.js";
|
|
4
4
|
import { C as y } from "./command-nBL1aO7T.js";
|
|
5
|
-
const
|
|
5
|
+
const L = new y().setManual({
|
|
6
6
|
purpose: "Fetch system information"
|
|
7
7
|
}).setExecute(async function(M, A) {
|
|
8
8
|
const { username: a, hostname: s, app: m, systemManager: f, settingsManager: C } = A, c = I.split(`
|
|
@@ -35,6 +35,6 @@ const N = new y().setManual({
|
|
|
35
35
|
`);
|
|
36
36
|
});
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
L as neofetch
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=neofetch-
|
|
40
|
+
//# sourceMappingURL=neofetch-DDgAqQZC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neofetch-DDgAqQZC.js","sources":["../../src/core/commands/neofetch.ts"],"sourcesContent":["import { SettingsManager, THEMES } from \"@prozilla-os/core\";\nimport { ANSI } from \"@prozilla-os/shared\";\nimport { ANSI_ASCII_LOGO, ANSI_LOGO_COLOR } from \"../../constants/terminal.const\";\nimport { Command, ExecuteParams } from \"../command\";\n\nexport const neofetch = new Command()\n\t.setManual({\n\t\tpurpose: \"Fetch system information\",\n\t})\n\t.setExecute(async function(_args, params) {\n\t\tconst { username, hostname, app, systemManager, settingsManager } = params as ExecuteParams;\n\t\tconst leftColumn = ANSI_ASCII_LOGO.split(\"\\n\");\n\t\tconst rightColumnWidth = (username?.length ?? 0) + (hostname?.length ?? 0) + 1;\n\n\t\tconst themeIndex = await settingsManager.getSettings(SettingsManager.VIRTUAL_PATHS.theme).get(\"theme\");\n\t\tlet theme = THEMES[0] as string;\n\t\tif (themeIndex != null && parseInt(themeIndex)) {\n\t\t\ttheme = THEMES[(themeIndex as unknown as number) ?? 0] as string ?? THEMES[0];\n\t\t}\n\n\t\tconst userAgent = navigator.userAgent;\n\n\t\t// Check for the browser name using regular expressions\n\t\tlet browserName: string;\n\t\tif (userAgent.match(/Firefox\\//)) {\n\t\t\tbrowserName = \"Mozilla Firefox\";\n\t\t} else if (userAgent.match(/Edg\\//)) {\n\t\t\tbrowserName = \"Microsoft Edge\";\n\t\t} else if (userAgent.match(/Chrome\\//)) {\n\t\t\tbrowserName = \"Google Chrome\";\n\t\t} else if (userAgent.match(/Safari\\//)) {\n\t\t\tbrowserName = \"Apple Safari\";\n\t\t} else {\n\t\t\tbrowserName = \"Unknown\";\n\t\t}\n\n\t\tconst formatLine = (label: string, text: string) => ANSI.fg.cyan + label.toUpperCase() + ANSI.reset + \": \" + text;\n\n\t\tconst rightColumn = [\n\t\t\t`${ANSI.fg.cyan + username + ANSI.reset}@${ANSI.fg.cyan + hostname + ANSI.reset}`,\n\t\t\t\"-\".repeat(rightColumnWidth),\n\t\t\tformatLine(\"os\", systemManager.systemName),\n\t\t\tformatLine(\"uptime\", systemManager.getUptime(2)),\n\t\t\tformatLine(\"resolution\", window.innerWidth + \"x\" + window.innerHeight),\n\t\t\tformatLine(\"theme\", theme),\n\t\t\tformatLine(\"icons\", \"Font Awesome\"),\n\t\t\tformatLine(\"terminal\", app?.name ?? \"Unknown\"),\n\t\t\tformatLine(\"browser\", browserName),\n\t\t\tformatLine(\"platform\", navigator.platform),\n\t\t\tformatLine(\"language\", navigator.language),\n\t\t\t\"\",\n\t\t\tObject.values(ANSI.fg).map((colorCode) => colorCode + \"███\").join(\"\") + ANSI.reset,\n\t\t];\n\n\t\tconst combined = [];\n\t\tfor (let i = 1; i < leftColumn.length; i++) {\n\t\t\tlet line = `${ANSI_LOGO_COLOR + leftColumn[i] + ANSI.reset} `;\n\n\t\t\tif (i <= rightColumn.length) {\n\t\t\t\tline += rightColumn[i - 1];\n\t\t\t} else {\n\t\t\t\t// This fixes a weird display bug on Safari mobile\n\t\t\t\tline += \" \".repeat(rightColumnWidth);\n\t\t\t}\n\n\t\t\tcombined.push(line);\n\t\t}\n\n\t\treturn combined.join(\"\\n\");\n\t});"],"names":["neofetch","Command","_args","params","username","hostname","app","systemManager","settingsManager","leftColumn","ANSI_ASCII_LOGO","rightColumnWidth","themeIndex","SettingsManager","theme","THEMES","userAgent","browserName","formatLine","label","text","ANSI","rightColumn","colorCode","combined","i","line","ANSI_LOGO_COLOR"],"mappings":";;;;AAKO,MAAMA,IAAW,IAAIC,EAAQ,EAClC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,eAAeC,GAAOC,GAAQ;AACzC,QAAM,EAAE,UAAAC,GAAU,UAAAC,GAAU,KAAAC,GAAK,eAAAC,GAAe,iBAAAC,EAAoB,IAAAL,GAC9DM,IAAaC,EAAgB,MAAM;AAAA,CAAI,GACvCC,MAAoBP,KAAA,gBAAAA,EAAU,WAAU,OAAMC,KAAA,gBAAAA,EAAU,WAAU,KAAK,GAEvEO,IAAa,MAAMJ,EAAgB,YAAYK,EAAgB,cAAc,KAAK,EAAE,IAAI,OAAO;AACjG,MAAAC,IAAQC,EAAO,CAAC;AACpB,EAAIH,KAAc,QAAQ,SAASA,CAAU,MAC5CE,IAAQC,EAAQH,KAAoC,CAAC,KAAeG,EAAO,CAAC;AAG7E,QAAMC,IAAY,UAAU;AAGxB,MAAAC;AACA,EAAAD,EAAU,MAAM,WAAW,IAChBC,IAAA,oBACJD,EAAU,MAAM,OAAO,IACnBC,IAAA,mBACJD,EAAU,MAAM,UAAU,IACtBC,IAAA,kBACJD,EAAU,MAAM,UAAU,IACtBC,IAAA,iBAEAA,IAAA;AAGf,QAAMC,IAAa,CAACC,GAAeC,MAAiBC,EAAK,GAAG,OAAOF,EAAM,YAAY,IAAIE,EAAK,QAAQ,OAAOD,GAEvGE,IAAc;AAAA,IACnB,GAAGD,EAAK,GAAG,OAAOjB,IAAWiB,EAAK,KAAK,IAAIA,EAAK,GAAG,OAAOhB,IAAWgB,EAAK,KAAK;AAAA,IAC/E,IAAI,OAAOV,CAAgB;AAAA,IAC3BO,EAAW,MAAMX,EAAc,UAAU;AAAA,IACzCW,EAAW,UAAUX,EAAc,UAAU,CAAC,CAAC;AAAA,IAC/CW,EAAW,cAAc,OAAO,aAAa,MAAM,OAAO,WAAW;AAAA,IACrEA,EAAW,SAASJ,CAAK;AAAA,IACzBI,EAAW,SAAS,cAAc;AAAA,IAClCA,EAAW,aAAYZ,KAAA,gBAAAA,EAAK,SAAQ,SAAS;AAAA,IAC7CY,EAAW,WAAWD,CAAW;AAAA,IACjCC,EAAW,YAAY,UAAU,QAAQ;AAAA,IACzCA,EAAW,YAAY,UAAU,QAAQ;AAAA,IACzC;AAAA,IACA,OAAO,OAAOG,EAAK,EAAE,EAAE,IAAI,CAACE,MAAcA,IAAY,KAAK,EAAE,KAAK,EAAE,IAAIF,EAAK;AAAA,EAAA,GAGxEG,IAAW,CAAA;AACjB,WAASC,IAAI,GAAGA,IAAIhB,EAAW,QAAQgB,KAAK;AAC3C,QAAIC,IAAO,GAAGC,IAAkBlB,EAAWgB,CAAC,IAAIJ,EAAK,KAAK;AAEtD,IAAAI,KAAKH,EAAY,SACZI,KAAAJ,EAAYG,IAAI,CAAC,IAGjBC,KAAA,IAAI,OAAOf,CAAgB,GAGpCa,EAAS,KAAKE,CAAI;AAAA,EACnB;AAEO,SAAAF,EAAS,KAAK;AAAA,CAAI;AAC1B,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pwd-CSapfDtw.js","sources":["../../src/core/commands/pwd.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const pwd = new Command()\n\t.setManual({\n\t\tpurpose: \"Display path of the current directory\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\n\t\tif (currentDirectory.root) {\n\t\t\treturn \"/\";\n\t\t} else {\n\t\t\treturn currentDirectory.absolutePath;\n\t\t}\n\t});"],"names":["pwd","Command","_args","params","currentDirectory"],"mappings":";AAEO,MAAMA,IAAM,IAAIC,EAAQ,EAC7B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,kBAAAC,EAAqB,IAAAD;AAE7B,SAAIC,EAAiB,OACb,MAEAA,EAAiB;AAE1B,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reboot-Bwxhoa8q.js","sources":["../../src/core/commands/reboot.ts"],"sourcesContent":["import { reloadViewport } from \"@prozilla-os/core\";\nimport { Command } from \"../command\";\n\nexport const reboot = new Command()\n\t.setManual({\n\t\tpurpose: \"Reboot the system\",\n\t})\n\t.setExecute(function() {\n\t\treloadViewport();\n\t\treturn { blank: true };\n\t});"],"names":["reboot","Command","reloadViewport"],"mappings":";;AAGO,MAAMA,IAAS,IAAIC,EAAQ,EAChC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,WAAW;AACP,SAAAC,KACR,EAAE,OAAO;AACjB,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as e } from "./command-nBL1aO7T.js";
|
|
2
|
-
import { C as a } from "./main-
|
|
2
|
+
import { C as a } from "./main-ieLHBWKy.js";
|
|
3
3
|
const t = new e().setManual({
|
|
4
4
|
purpose: "Reload the terminal"
|
|
5
5
|
}).setExecute(function() {
|
|
@@ -8,4 +8,4 @@ const t = new e().setManual({
|
|
|
8
8
|
export {
|
|
9
9
|
t as reload
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=reload-
|
|
11
|
+
//# sourceMappingURL=reload-Dy-4yWsY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reload-Dy-4yWsY.js","sources":["../../src/core/commands/reload.ts"],"sourcesContent":["import { Command } from \"../command\";\r\nimport { CommandsManager } from \"../commands\";\r\n\r\nexport const reload = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Reload the terminal\",\r\n\t})\r\n\t.setExecute(function() {\r\n\t\tCommandsManager.reload();\r\n\t\treturn { blank: true };\r\n\t});"],"names":["reload","Command","CommandsManager"],"mappings":";;AAGO,MAAMA,IAAS,IAAIC,EAAQ,EAChC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,WAAW;AACtB,SAAAC,EAAgB,OAAO,GAChB,EAAE,OAAO;AACjB,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rev-C8qQIyj_.js","sources":["../../src/core/commands/rev.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const rev = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the reverse of a text\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { rawInputValue } = params as ExecuteParams;\n\t\treturn rawInputValue?.split(\"\").reverse().join(\"\");\n\t});"],"names":["rev","Command","_args","params","rawInputValue"],"mappings":";AAEO,MAAMA,IAAM,IAAIC,EAAQ,EAC7B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,eAAAC,EAAkB,IAAAD;AAC1B,SAAOC,KAAA,gBAAAA,EAAe,MAAM,IAAI,UAAU,KAAK;AAChD,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VirtualFile as m } from "@prozilla-os/core";
|
|
2
|
-
import { f } from "./main-
|
|
2
|
+
import { f } from "./main-ieLHBWKy.js";
|
|
3
3
|
import { C as u } from "./command-nBL1aO7T.js";
|
|
4
4
|
const p = new u().setRequireArgs(!0).setManual({
|
|
5
5
|
purpose: "Remove a file"
|
|
@@ -10,4 +10,4 @@ const p = new u().setRequireArgs(!0).setManual({
|
|
|
10
10
|
export {
|
|
11
11
|
p as rm
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=rm-
|
|
13
|
+
//# sourceMappingURL=rm-BssAo3hK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rm-BssAo3hK.js","sources":["../../src/core/commands/rm.ts"],"sourcesContent":["import { VirtualFile } from \"@prozilla-os/core\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nexport const rm = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Remove a file\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\t\tconst fileId = (args as string[])[0];\n\t\tconst { name, extension } = VirtualFile.splitId(fileId);\n\t\tconst file = currentDirectory.findFile(name, extension);\n\t\n\t\tif (!file)\n\t\t\treturn formatError(this.name, `${fileId}: No such file`);\n\t\t\n\t\tfile.delete();\n\t\treturn { blank: true };\n\t});"],"names":["rm","Command","args","params","currentDirectory","fileId","name","extension","VirtualFile","file","formatError"],"mappings":";;;AAIO,MAAMA,IAAK,IAAIC,IACpB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAUH,EAAkB,CAAC,GAC7B,EAAE,MAAAI,GAAM,WAAAC,EAAA,IAAcC,EAAY,QAAQH,CAAM,GAChDI,IAAOL,EAAiB,SAASE,GAAMC,CAAS;AAEtD,SAAKE,KAGLA,EAAK,OAAO,GACL,EAAE,OAAO,QAHRC,EAAY,KAAK,MAAM,GAAGL,CAAM,gBAAgB;AAIzD,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as s } from "./main-
|
|
1
|
+
import { f as s } from "./main-ieLHBWKy.js";
|
|
2
2
|
import { C as u } from "./command-nBL1aO7T.js";
|
|
3
3
|
const m = new u().setRequireArgs(!0).setManual({
|
|
4
4
|
purpose: "Remove a directory"
|
|
@@ -9,4 +9,4 @@ const m = new u().setRequireArgs(!0).setManual({
|
|
|
9
9
|
export {
|
|
10
10
|
m as rmdir
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=rmdir-
|
|
12
|
+
//# sourceMappingURL=rmdir-iKWxmkTT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rmdir-iKWxmkTT.js","sources":["../../src/core/commands/rmdir.ts"],"sourcesContent":["import { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nexport const rmdir = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Remove a directory\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\t\tconst folderName = (args as string[])[0];\n\t\tconst folder = currentDirectory.findSubFolder(folderName);\n\t\n\t\tif (!folder)\n\t\t\treturn formatError(this.name, `${folderName}: No such directory`);\n\t\t\n\t\tfolder.delete();\n\t\treturn { blank: true };\n\t});"],"names":["rmdir","Command","args","params","currentDirectory","folderName","folder","formatError"],"mappings":";;AAGO,MAAMA,IAAQ,IAAIC,IACvB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAcH,EAAkB,CAAC,GACjCI,IAASF,EAAiB,cAAcC,CAAU;AAExD,SAAKC,KAGLA,EAAO,OAAO,GACP,EAAE,OAAO,QAHRC,EAAY,KAAK,MAAM,GAAGF,CAAU,qBAAqB;AAIlE,CAAC;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as p, S as g } from "./main-
|
|
1
|
+
import { f as p, S as g } from "./main-ieLHBWKy.js";
|
|
2
2
|
import { C as w } from "./command-nBL1aO7T.js";
|
|
3
3
|
const I = 1.25, i = [
|
|
4
4
|
[
|
|
@@ -164,4 +164,4 @@ sl -w number`,
|
|
|
164
164
|
export {
|
|
165
165
|
M as sl
|
|
166
166
|
};
|
|
167
|
-
//# sourceMappingURL=sl-
|
|
167
|
+
//# sourceMappingURL=sl-BbE5ahZH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sl-BbE5ahZH.js","sources":["../../src/core/commands/sl.ts"],"sourcesContent":["import { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\nimport { Stream } from \"../stream\";\n\nconst ANIMATION_SPEED = 1.25;\n\nconst LOCOMOTIVE_SMOKE = [\n\t[\n\t\t\" (@@) ( ) (@) ( ) @@ () @ o @ o\",\n\t\t\" ( )\",\n\t\t\" (@@@@)\",\n\t\t\" ( )\",\n\t\t\"\",\n\t\t\" (@@@)\",\n\t],\n\t[\n\t\t\" ( ) (@@) ( ) (@) () @@ o @ o @\",\n\t\t\" (@@@)\",\n\t\t\" ( )\",\n\t\t\" (@@@@)\",\n\t\t\"\",\n\t\t\" ( )\",\n\t],\n];\n\nconst LOCOMOTIVE_TOP = [\n\t\" ==== ________ ___________\",\n\t\" _D _| |_______/ \\\\__I_I_____===__|_________|\",\n\t\" |(_)--- | H\\\\________/ | | =|___ ___| \",\n\t\" / | | H | | | | ||_| |_|| \",\n\t\" | | | H |__--------------------| [___] | \",\n\t\" | ________|___H__/__|_____/[][]~\\\\_______| | \",\n\t\" |/ | |-----------I_____I [][] [] D |=======|__\",\n];\n\nconst LOCOMOTIVE_BOTTOM = [\n\t[\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\n\t\t\" \\\\_/ \\\\O=====O=====O=====O_/ \\\\_/ \",\n\t],\n\t[\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\n\t\t\" |/-=|___|=O=====O=====O=====O |_____/~\\\\___/ \",\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\n\t],\n\t[\n\t\t\"__/ =| o |=-O=====O=====O=====O \\\\ ____Y___________|__\",\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\n\t],\n\t[\n\t\t\"__/ =| o |=-~O=====O=====O=====O\\\\ ____Y___________|__\",\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\n\t],\n\t[\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\n\t\t\" |/-=|___|= O=====O=====O=====O|_____/~\\\\___/ \",\n\t\t\" \\\\_/ \\\\__/ \\\\__/ \\\\__/ \\\\__/ \\\\_/ \",\n\t],\n\t[\n\t\t\"__/ =| o |=-~~\\\\ /~~\\\\ /~~\\\\ /~~\\\\ ____Y___________|__\",\n\t\t\" |/-=|___|= || || || |_____/~\\\\___/ \",\n\t\t\" \\\\_/ \\\\_O=====O=====O=====O/ \\\\_/ \",\n\t],\n].reverse();\n\nconst COAL_WAGON = [\n\t\" \",\n\t\" _________________ \",\n\t\" _| \\\\_____A \",\n\t\" =| | \",\n\t\" -| | \",\n\t\"__|________________________|_\",\n\t\"|__________________________|_\",\n\t\" |_D__D__D_| |_D__D__D_| \",\n\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\n];\n\nconst EXTRA_WAGONS = [\n\t[\n\t\t\" _______================_______ \",\n\t\t\" | | ___ ___ ___ ___ | | \",\n\t\t\" | | | | | | | | | | | | \",\n\t\t\" | | |_| |_| |_| |_| | | \",\n\t\t\" | | | | \",\n\t\t\"__|__|____________________|__|__\",\n\t\t\"_|____________________________|_\",\n\t\t\" |_D__D__D_| |_D__D__D_| \",\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\n\t],\n\t[\n\t\t\" \",\n\t\t\" ________========__HH____ \",\n\t\t\" / HH \\\\ \",\n\t\t\"/ HH \\\\ \",\n\t\t\"\\\\ HH / \",\n\t\t\"_\\\\__________________HH____/__\",\n\t\t\"|__________________________|_\",\n\t\t\" |_D__D__D_| |_D__D__D_| \",\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\n\t],\n\t[\n\t\t\" \",\n\t\t\" \",\n\t\t\" \",\n\t\t\" \",\n\t\t\" \",\n\t\t\"_____________________________\",\n\t\t\"|__________________________|_\",\n\t\t\" |_D__D__D_| |_D__D__D_| \",\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\n\t],\n\t[\n\t\t\" \",\n\t\t\" _|__|___________|__|___ \",\n\t\t\" (_|__|___________|__|___) \",\n\t\t\" _(|__|___________|__|__)_ \",\n\t\t\" (__|__|___________|__|____)\",\n\t\t\"_(___|__|___________|__|__)__\",\n\t\t\"|__________________________|_\",\n\t\t\" |_D__D__D_| |_D__D__D_| \",\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\n\t],\n\t[\n\t\t\" \",\n\t\t\" ___________________________ \",\n\t\t\" \\\\ | | / \",\n\t\t\" \\\\ | | / \",\n\t\t\" |\\\\ | | /| \",\n\t\t\"__|_\\\\___|___________|___/_|__\",\n\t\t\"|__________________________|_\",\n\t\t\" |_D__D__D_| |_D__D__D_| \",\n\t\t\" \\\\_/ \\\\_/ \\\\_/ \\\\_/ \",\n\t],\n];\n\nfunction generateLocomotive(frame: number, wagonCount = 1) {\n\tconst smokeHeight = LOCOMOTIVE_SMOKE[0].length;\n\tconst locomotiveHeight = LOCOMOTIVE_TOP.length + LOCOMOTIVE_BOTTOM[0].length;\n\tconst wagonHeight = COAL_WAGON.length;\n\n\tconst wagonStart = smokeHeight + locomotiveHeight - wagonHeight;\n\n\tconst smoke = LOCOMOTIVE_SMOKE[Math.round(frame / 4) % LOCOMOTIVE_SMOKE.length];\n\tconst top = LOCOMOTIVE_TOP;\n\tconst bottom = LOCOMOTIVE_BOTTOM[frame % LOCOMOTIVE_BOTTOM.length];\n\n\tconst distance = 50 - frame;\n\tconst locomotive = smoke.concat(top, bottom).map((line, index) => {\n\t\tif (index >= wagonStart && wagonCount > 0) {\n\t\t\tfor (let i = 0; i < wagonCount; i++) {\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tline += COAL_WAGON[index - wagonStart];\n\t\t\t\t} else {\n\t\t\t\t\tline += EXTRA_WAGONS[(i - 1) % EXTRA_WAGONS.length][index - wagonStart];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (distance === 0) {\n\t\t\treturn line;\n\t\t} else if (distance > 0) {\n\t\t\treturn \" \".repeat(distance) + line;\n\t\t} else {\n\t\t\tline = line.slice(-distance);\n\t\t\treturn line;\n\t\t}\n\t}).join(\"\\n\");\n\n\treturn `\\n${locomotive}\\n`;\n}\n\nexport const sl = new Command()\n\t.setManual({\n\t\tpurpose: \"Show animations aimed to correct users who accidentally enter sl instead of ls. SL stands for Steam Locomotive.\",\n\t\tusage: \"sl\\n\"\n\t\t\t+ \"sl -w number\",\n\t\toptions: {\n\t\t\t\"-w number\": \"Set the amount of wagons (defaults to 1)\",\n\t\t},\n\t})\n\t.addOption({\n\t\tshort: \"w\",\n\t\tlong: \"wagons\",\n\t\tisInput: true,\n\t})\n\t.setExecute(function(this: Command, _args, params) {\n\t\tconst { inputs } = params as ExecuteParams;\n\t\tlet wagonCount = 1;\n\n\t\tif (inputs?.w) {\n\t\t\twagonCount = parseInt(inputs.w);\n\n\t\t\tif (!wagonCount || wagonCount < 0) {\n\t\t\t\treturn formatError(this.name, \"Please specify a valid amount of wagons\"); \n\t\t\t}\n\t\t}\n\n\t\tconst stream = new Stream();\n\n\t\tlet frame = 0;\n\t\tconst interval = setInterval(() => {\n\t\t\tconst text = generateLocomotive(frame, wagonCount);\n\t\t\tstream.send(text);\n\t\t\tframe++;\n\n\t\t\tif (text.trim().length === 0)\n\t\t\t\tstream.stop();\n\t\t}, 100 / ANIMATION_SPEED);\n\n\t\tstream.on(Stream.EVENT_NAMES.stop, () => {\n\t\t\tclearInterval(interval);\n\t\t});\n\n\t\tstream.start();\n\n\t\treturn stream;\n\t});"],"names":["ANIMATION_SPEED","LOCOMOTIVE_SMOKE","LOCOMOTIVE_TOP","LOCOMOTIVE_BOTTOM","COAL_WAGON","EXTRA_WAGONS","generateLocomotive","frame","wagonCount","smokeHeight","locomotiveHeight","wagonHeight","wagonStart","smoke","top","bottom","distance","line","index","i","sl","Command","_args","params","inputs","formatError","stream","Stream","interval","text"],"mappings":";;AAIA,MAAMA,IAAkB,MAElBC,IAAmB;AAAA,EACxB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,GAEMC,IAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEMC,IAAoB;AAAA,EACzB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,EAAE,QAAQ,GAEJC,IAAa;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEMC,IAAe;AAAA,EACpB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;AAEA,SAASC,EAAmBC,GAAeC,IAAa,GAAG;AACpD,QAAAC,IAAcR,EAAiB,CAAC,EAAE,QAClCS,IAAmBR,EAAe,SAASC,EAAkB,CAAC,EAAE,QAChEQ,IAAcP,EAAW,QAEzBQ,IAAaH,IAAcC,IAAmBC,GAE9CE,IAAQZ,EAAiB,KAAK,MAAMM,IAAQ,CAAC,IAAIN,EAAiB,MAAM,GACxEa,IAAMZ,GACNa,IAASZ,EAAkBI,IAAQJ,EAAkB,MAAM,GAE3Da,IAAW,KAAKT;AAsBf,SAAA;AAAA,EArBYM,EAAM,OAAOC,GAAKC,CAAM,EAAE,IAAI,CAACE,GAAMC,MAAU;AAC7D,QAAAA,KAASN,KAAcJ,IAAa;AACvC,eAASW,IAAI,GAAGA,IAAIX,GAAYW;AAC/B,QAAIA,MAAM,IACDF,KAAAb,EAAWc,IAAQN,CAAU,IAErCK,KAAQZ,GAAcc,IAAI,KAAKd,EAAa,MAAM,EAAEa,IAAQN,CAAU;AAKzE,WAAII,MAAa,IACTC,IACGD,IAAW,IACd,IAAI,OAAOA,CAAQ,IAAIC,KAEvBA,IAAAA,EAAK,MAAM,CAACD,CAAQ,GACpBC;AAAA,EACR,CACA,EAAE,KAAK;AAAA,CAAI,CAEU;AAAA;AACvB;AAEO,MAAMG,IAAK,IAAIC,EAAQ,EAC5B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA;AAAA,EAEP,SAAS;AAAA,IACR,aAAa;AAAA,EACd;AACD,CAAC,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAOC,GAAQ;AAC5C,QAAA,EAAE,QAAAC,EAAW,IAAAD;AACnB,MAAIf,IAAa;AAEjB,MAAIgB,KAAA,QAAAA,EAAQ,MACEhB,IAAA,SAASgB,EAAO,CAAC,GAE1B,CAAChB,KAAcA,IAAa;AACxB,WAAAiB,EAAY,KAAK,MAAM,yCAAyC;AAInE,QAAAC,IAAS,IAAIC;AAEnB,MAAIpB,IAAQ;AACN,QAAAqB,IAAW,YAAY,MAAM;AAC5B,UAAAC,IAAOvB,EAAmBC,GAAOC,CAAU;AACjD,IAAAkB,EAAO,KAAKG,CAAI,GAChBtB,KAEIsB,EAAK,OAAO,WAAW,KAC1BH,EAAO,KAAK;AAAA,EAAA,GACX,MAAM1B,CAAe;AAExB,SAAA0B,EAAO,GAAGC,EAAO,YAAY,MAAM,MAAM;AACxC,kBAAcC,CAAQ;AAAA,EAAA,CACtB,GAEDF,EAAO,MAAM,GAENA;AACR,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VirtualFile as s } from "@prozilla-os/core";
|
|
2
|
-
import { f as a } from "./main-
|
|
2
|
+
import { f as a } from "./main-ieLHBWKy.js";
|
|
3
3
|
import { C as c } from "./command-nBL1aO7T.js";
|
|
4
4
|
const l = new c().setRequireArgs(!0).setManual({
|
|
5
5
|
purpose: "Change file timestamps",
|
|
@@ -17,4 +17,4 @@ A file argument that does not exist is created empty.`
|
|
|
17
17
|
export {
|
|
18
18
|
l as touch
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=touch-
|
|
20
|
+
//# sourceMappingURL=touch-DP1jSzBq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touch-DP1jSzBq.js","sources":["../../src/core/commands/touch.ts"],"sourcesContent":["import { VirtualFile } from \"@prozilla-os/core\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command, ExecuteParams } from \"../command\";\n\nexport const touch = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Change file timestamps\",\n\t\tusage: \"touch [options] files\",\n\t\tdescription: \"Update the access and modification times of each FILE to the current time.\\n\\n\"\n\t\t\t+ \"A file argument that does not exist is created empty.\",\n\t})\n\t.setExecute(function(this: Command, args, params) {\n\t\tconst { currentDirectory } = params as ExecuteParams;\n\t\tconst fileId = (args as string[])[0];\n\n\t\tif (fileId === \"girls\\\\\" && (args as string[])[1] === \"boo**\")\n\t\t\treturn formatError((this).name, \"Cannot touch 'girls boo**': Permission denied\");\n\t\n\t\tconst { name, extension } = VirtualFile.splitId(fileId);\n\t\n\t\tif (currentDirectory.findFile(name, extension))\n\t\t\treturn { blank: true };\n\t\n\t\tcurrentDirectory.createFile(name, extension as string | undefined);\n\t\treturn { blank: true };\n\t});"],"names":["touch","Command","args","params","currentDirectory","fileId","formatError","name","extension","VirtualFile"],"mappings":";;;AAIO,MAAMA,IAAQ,IAAIC,IACvB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA;AAAA;AAEd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAUH,EAAkB,CAAC;AAEnC,MAAIG,MAAW,aAAcH,EAAkB,CAAC,MAAM;AAC9C,WAAAI,EAAa,KAAM,MAAM,+CAA+C;AAEhF,QAAM,EAAE,MAAAC,GAAM,WAAAC,EAAA,IAAcC,EAAY,QAAQJ,CAAM;AAElD,SAAAD,EAAiB,SAASG,GAAMC,CAAS,IACrC,EAAE,OAAO,QAEAJ,EAAA,WAAWG,GAAMC,CAA+B,GAC1D,EAAE,OAAO;AACjB,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uptime-BYmCcOUM.js","sources":["../../src/core/commands/uptime.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const uptime = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the current uptime of the system\",\n\t})\n\t.setExecute(function(_args, params) {\n\t\tconst { systemManager } = params as ExecuteParams;\n\t\treturn `Uptime: ${systemManager.getUptime(2)}`;\n\t});"],"names":["uptime","Command","_args","params","systemManager"],"mappings":";AAEO,MAAMA,IAAS,IAAIC,EAAQ,EAChC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAOC,GAAQ;AAC7B,QAAA,EAAE,eAAAC,EAAkB,IAAAD;AAC1B,SAAO,WAAWC,EAAc,UAAU,CAAC,CAAC;AAC7C,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ANSI as t } from "@prozilla-os/shared";
|
|
2
|
-
import { C as e, f as a } from "./main-
|
|
2
|
+
import { C as e, f as a } from "./main-ieLHBWKy.js";
|
|
3
3
|
import { C as s } from "./command-nBL1aO7T.js";
|
|
4
4
|
const p = new s().setRequireArgs(!0).setManual({
|
|
5
5
|
purpose: "Show information about a command"
|
|
@@ -11,4 +11,4 @@ const p = new s().setRequireArgs(!0).setManual({
|
|
|
11
11
|
export {
|
|
12
12
|
p as whatis
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=whatis-
|
|
14
|
+
//# sourceMappingURL=whatis-Dd0ZBHZz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whatis-Dd0ZBHZz.js","sources":["../../src/core/commands/whatis.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\nimport { formatError } from \"../_utils/terminal.utils\";\nimport { Command } from \"../command\";\nimport { CommandsManager } from \"../commands\";\n\nexport const whatis = new Command()\n\t.setRequireArgs(true)\n\t.setManual({\n\t\tpurpose: \"Show information about a command\",\n\t})\n\t.setExecute(function(this: Command, args) {\n\t\tconst commandName = (args as string[])[0].toLowerCase();\n\t\tconst command = CommandsManager.find(commandName);\n\n\t\tif (!command)\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\n\n\t\tif (!command.manual?.purpose)\n\t\t\treturn formatError(this.name, `${commandName}: No information found`);\n\n\t\treturn `${commandName} - ${ANSI.fg.green}${command.manual.purpose}`;\n\t});"],"names":["whatis","Command","args","commandName","command","CommandsManager","_a","ANSI","formatError"],"mappings":";;;AAKO,MAAMA,IAAS,IAAIC,IACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAAwBC,GAAM;;AACzC,QAAMC,IAAeD,EAAkB,CAAC,EAAE,YAAY,GAChDE,IAAUC,EAAgB,KAAKF,CAAW;AAEhD,SAAKC,KAGAE,IAAAF,EAAQ,WAAR,QAAAE,EAAgB,UAGd,GAAGH,CAAW,MAAMI,EAAK,GAAG,KAAK,GAAGH,EAAQ,OAAO,OAAO,KAFzDI,EAAY,KAAK,MAAM,GAAGL,CAAW,wBAAwB,IAH7DK,EAAY,KAAK,MAAM,GAAGL,CAAW,qBAAqB;AAMnE,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami-CQNGmqxL.js","sources":["../../src/core/commands/whoami.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\n\nexport const whoami = new Command()\n\t.setManual({\n\t\tpurpose: \"Display the username\",\n\t})\n\t.setExecute((_args, params) => {\n\t\tconst { username } = params as ExecuteParams;\n\t\treturn username;\n\t});"],"names":["whoami","Command","_args","params","username"],"mappings":";AAEO,MAAMA,IAAS,IAAIC,EAAQ,EAChC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,CAACC,GAAOC,MAAW;AACxB,QAAA,EAAE,UAAAC,EAAa,IAAAD;AACd,SAAAC;AACR,CAAC;"}
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('._Terminal_1l267_1{--char-width: .585rem;display:flex;flex-direction:column;align-items:flex-start;padding:.5rem;overflow:auto;height:100%;cursor:text}._Terminal_1l267_1 *{font-family:var(--mono-font-family);letter-spacing:-.03em}._Terminal_1l267_1 p,._Terminal_1l267_1 pre{margin:0;height:1.25rem;line-height:inherit;font-size:inherit;letter-spacing:inherit}._Prefix_1l267_51{display:flex;width:max-content;white-space:nowrap}._Input_1l267_63,._Output_1l267_63{display:flex;flex-direction:row;align-items:center;width:100%;line-height:1.25rem;font-size:1rem;text-align:start;white-space:pre}._Input_1l267_63{height:1.25rem}._Input-container_1l267_93{--cursor-width: var(--char-width);--cursor-offset: 0;position:relative;height:100%;width:fit-content}._Input-container_1l267_93:after{content:"";position:absolute;top:0;left:calc(var(--cursor-offset) * var(--char-width) * .9746124950079872);width:var(--cursor-width);height:100%;background-color:var(--foreground-color-0);animation:_blink_1l267_1 1s step-end infinite}._Input-container_1l267_93 input{opacity:0;position:absolute;left:0;width:100%;padding:0;background:none;border:none;outline:none;font-size:inherit;caret-color:transparent}@keyframes _blink_1l267_1{0%,to{background-color:transparent}50%{background-color:var(--foreground-color-0)}}._Input_1l267_63 label{position:absolute;width:100%;height:100%;top:0;left:0;cursor:text}._ansi-black-fg_1l267_197{color:var(--black-2)}._ansi-red-fg_1l267_199{color:var(--red-0)}._ansi-green-fg_1l267_201{color:var(--green-0)}._ansi-yellow-fg_1l267_203{color:var(--yellow-0)}._ansi-blue-fg_1l267_205{color:var(--blue-0)}._ansi-magenta-fg_1l267_207{color:var(--purple-0)}._ansi-cyan-fg_1l267_209{color:var(--cyan-0)}._ansi-white-fg_1l267_211{color:var(--foreground-color-0)}._ansi-bright-black-fg_1l267_215{color:var(--black-2)}._ansi-bright-red-fg_1l267_217{color:var(--red-0)}._ansi-bright-green-fg_1l267_219{color:var(--green-0)}._ansi-bright-yellow-fg_1l267_221{color:var(--yellow-0)}._ansi-bright-blue-fg_1l267_223{color:var(--blue-0)}._ansi-bright-magenta-fg_1l267_225{color:var(--purple-0)}._ansi-bright-cyan-fg_1l267_227{color:var(--cyan-0)}._ansi-bright-white-fg_1l267_229{color:var(--foreground-color-0)}._ansi-black-bg_1l267_233{background-color:var(--black-2)}._ansi-red-bg_1l267_235{background-color:var(--red-0)}._ansi-green-bg_1l267_237{background-color:var(--green-0)}._ansi-yellow-bg_1l267_239{background-color:var(--yellow-0)}._ansi-blue-bg_1l267_241{background-color:var(--blue-0)}._ansi-magenta-bg_1l267_243{background-color:var(--purple-0)}._ansi-cyan-bg_1l267_245{background-color:var(--cyan-0)}._ansi-white-bg_1l267_247{background-color:var(--foreground-color-0)}._ansi-dim_1l267_251{opacity:.65}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
1
2
|
import "@prozilla-os/core";
|
|
2
|
-
import { t as o } from "./main-
|
|
3
|
+
import { t as o } from "./chunks/main-ieLHBWKy.js";
|
|
3
4
|
export {
|
|
4
5
|
o as terminal
|
|
5
6
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prozilla-os/terminal",
|
|
3
3
|
"description": "A terminal/shell application for ProzillaOS.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.9",
|
|
5
5
|
"homepage": "https://os.prozilla.dev/terminal",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Prozilla",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"anser": "^2.1.1",
|
|
23
23
|
"escape-carriage": "^1.3.1",
|
|
24
24
|
"react": "^18.3.1",
|
|
25
|
-
"@prozilla-os/core": "1.3.
|
|
25
|
+
"@prozilla-os/core": "1.3.3",
|
|
26
26
|
"@prozilla-os/shared": "1.2.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^20.14.5",
|
|
30
30
|
"@types/react": "^18.3.3",
|
|
31
31
|
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
32
|
-
"typescript": "^5.4
|
|
32
|
+
"typescript": "^5.5.4",
|
|
33
33
|
"vite": "^5.4.8",
|
|
34
34
|
"vite-plugin-dts": "^3.9.1",
|
|
35
35
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
36
|
-
"@prozilla-os/dev-tools": "1.0
|
|
36
|
+
"@prozilla-os/dev-tools": "1.1.0"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist"
|
package/dist/assets/main.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._Terminal_1l267_1{--char-width: .585rem;display:flex;flex-direction:column;align-items:flex-start;padding:.5rem;overflow:auto;height:100%;cursor:text}._Terminal_1l267_1 *{font-family:var(--mono-font-family);letter-spacing:-.03em}._Terminal_1l267_1 p,._Terminal_1l267_1 pre{margin:0;height:1.25rem;line-height:inherit;font-size:inherit;letter-spacing:inherit}._Prefix_1l267_51{display:flex;width:max-content;white-space:nowrap}._Input_1l267_63,._Output_1l267_63{display:flex;flex-direction:row;align-items:center;width:100%;line-height:1.25rem;font-size:1rem;text-align:start;white-space:pre}._Input_1l267_63{height:1.25rem}._Input-container_1l267_93{--cursor-width: var(--char-width);--cursor-offset: 0;position:relative;height:100%;width:fit-content}._Input-container_1l267_93:after{content:"";position:absolute;top:0;left:calc(var(--cursor-offset) * var(--char-width) * .9746124950079872);width:var(--cursor-width);height:100%;background-color:var(--foreground-color-0);animation:_blink_1l267_1 1s step-end infinite}._Input-container_1l267_93 input{opacity:0;position:absolute;left:0;width:100%;padding:0;background:none;border:none;outline:none;font-size:inherit;caret-color:transparent}@keyframes _blink_1l267_1{0%,to{background-color:transparent}50%{background-color:var(--foreground-color-0)}}._Input_1l267_63 label{position:absolute;width:100%;height:100%;top:0;left:0;cursor:text}._ansi-black-fg_1l267_197{color:var(--black-2)}._ansi-red-fg_1l267_199{color:var(--red-0)}._ansi-green-fg_1l267_201{color:var(--green-0)}._ansi-yellow-fg_1l267_203{color:var(--yellow-0)}._ansi-blue-fg_1l267_205{color:var(--blue-0)}._ansi-magenta-fg_1l267_207{color:var(--purple-0)}._ansi-cyan-fg_1l267_209{color:var(--cyan-0)}._ansi-white-fg_1l267_211{color:var(--foreground-color-0)}._ansi-bright-black-fg_1l267_215{color:var(--black-2)}._ansi-bright-red-fg_1l267_217{color:var(--red-0)}._ansi-bright-green-fg_1l267_219{color:var(--green-0)}._ansi-bright-yellow-fg_1l267_221{color:var(--yellow-0)}._ansi-bright-blue-fg_1l267_223{color:var(--blue-0)}._ansi-bright-magenta-fg_1l267_225{color:var(--purple-0)}._ansi-bright-cyan-fg_1l267_227{color:var(--cyan-0)}._ansi-bright-white-fg_1l267_229{color:var(--foreground-color-0)}._ansi-black-bg_1l267_233{background-color:var(--black-2)}._ansi-red-bg_1l267_235{background-color:var(--red-0)}._ansi-green-bg_1l267_237{background-color:var(--green-0)}._ansi-yellow-bg_1l267_239{background-color:var(--yellow-0)}._ansi-blue-bg_1l267_241{background-color:var(--blue-0)}._ansi-magenta-bg_1l267_243{background-color:var(--purple-0)}._ansi-cyan-bg_1l267_245{background-color:var(--cyan-0)}._ansi-white-bg_1l267_247{background-color:var(--foreground-color-0)}._ansi-dim_1l267_251{opacity:.65}
|
package/dist/cat-BhP4PEUK.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat-BhP4PEUK.js","sources":["../src/core/commands/cat.ts"],"sourcesContent":["import { VirtualFile } from \"@prozilla-os/core\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const cat = new Command()\r\n\t.setRequireArgs(true)\r\n\t.setManual({\r\n\t\tpurpose: \"Concetenate files and display on the terminal screen\",\r\n\t\tusage: \"cat [options] [files]\",\r\n\t\tdescription: \"Concetenate files to standard output.\"\r\n\t})\r\n\t.setExecute(function(this: Command, args, params) {\r\n\t\tconst { currentDirectory, options } = params as ExecuteParams;\r\n\t\tconst fileId = (args as string[])[0];\r\n\t\tconst { name, extension } = VirtualFile.splitId(fileId);\r\n\t\tconst file = currentDirectory.findFile(name, extension);\r\n\r\n\t\tif (!file)\r\n\t\t\treturn formatError(this.name, `${fileId}: No such file`);\r\n\r\n\t\tif (file.content) {\r\n\t\t\tif (!options?.includes(\"e\")) {\r\n\t\t\t\treturn file.content;\r\n\t\t\t} else {\r\n\t\t\t\t// Append \"$\" at the end of every line\r\n\t\t\t\treturn file.content.split(\"\\n\").join(\"$\\n\") + \"$\";\r\n\t\t\t}\r\n\t\t} else if (file.source) {\r\n\t\t\treturn `Src: ${file.source}`;\r\n\t\t} else {\r\n\t\t\treturn { blank: true };\r\n\t\t}\r\n\t});"],"names":["cat","Command","args","params","currentDirectory","options","fileId","name","extension","VirtualFile","file","formatError"],"mappings":";;;AAIO,MAAMA,IAAM,IAAIC,IACrB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,GAAkB,SAAAC,EAAY,IAAAF,GAChCG,IAAUJ,EAAkB,CAAC,GAC7B,EAAE,MAAAK,GAAM,WAAAC,EAAA,IAAcC,EAAY,QAAQH,CAAM,GAChDI,IAAON,EAAiB,SAASG,GAAMC,CAAS;AAEtD,SAAKE,IAGDA,EAAK,UACHL,KAAA,QAAAA,EAAS,SAAS,OAIfK,EAAK,QAAQ,MAAM;AAAA,CAAI,EAAE,KAAK;AAAA,CAAK,IAAI,MAHvCA,EAAK,UAKHA,EAAK,SACR,QAAQA,EAAK,MAAM,KAEnB,EAAE,OAAO,OAZTC,EAAY,KAAK,MAAM,GAAGL,CAAM,gBAAgB;AAczD,CAAC;"}
|
package/dist/cd-Dm40ypzX.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { f as a } from "./main-BXcuHQUl.js";
|
|
2
|
-
import { C as c } from "./command-nBL1aO7T.js";
|
|
3
|
-
const d = new c().setManual({
|
|
4
|
-
purpose: "Change the current directory",
|
|
5
|
-
usage: "cd [PATH]",
|
|
6
|
-
description: "Change working directory to given path (the home directory by default)."
|
|
7
|
-
}).setExecute(function(e, o) {
|
|
8
|
-
const { currentDirectory: n, setCurrentDirectory: t } = o, i = e[0] ?? "~", r = n.navigate(i);
|
|
9
|
-
return r ? (t == null || t(r), { blank: !0 }) : a(this.name, `${e[0]}: No such file or directory`);
|
|
10
|
-
});
|
|
11
|
-
export {
|
|
12
|
-
d as cd
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=cd-Dm40ypzX.js.map
|
package/dist/cd-Dm40ypzX.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cd-Dm40ypzX.js","sources":["../src/core/commands/cd.ts"],"sourcesContent":["import { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const cd = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Change the current directory\",\r\n\t\tusage: \"cd [PATH]\",\r\n\t\tdescription: \"Change working directory to given path (the home directory by default).\"\r\n\t})\r\n\t.setExecute(function(this: Command, args, params) {\r\n\t\tconst { currentDirectory, setCurrentDirectory } = params as ExecuteParams;\r\n\t\tconst path = (args as string[])[0] ?? \"~\";\r\n\t\tconst destination = currentDirectory.navigate(path);\r\n\t\r\n\t\tif (!destination)\r\n\t\t\treturn formatError(this.name, `${(args as string[])[0]}: No such file or directory`);\r\n\t\r\n\t\tsetCurrentDirectory?.(destination);\r\n\t\treturn { blank: true };\r\n\t});"],"names":["cd","Command","args","params","currentDirectory","setCurrentDirectory","path","destination","formatError"],"mappings":";;AAGO,MAAMA,IAAK,IAAIC,EAAQ,EAC5B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,GAAkB,qBAAAC,EAAwB,IAAAF,GAC5CG,IAAQJ,EAAkB,CAAC,KAAK,KAChCK,IAAcH,EAAiB,SAASE,CAAI;AAElD,SAAKC,KAGLF,KAAA,QAAAA,EAAsBE,IACf,EAAE,OAAO,QAHRC,EAAY,KAAK,MAAM,GAAIN,EAAkB,CAAC,CAAC,6BAA6B;AAIrF,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clear-DtYBxmDr.js","sources":["../src/core/commands/clear.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const clear = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Clear terminal screen\",\r\n\t})\r\n\t.setExecute(function(args, params) {\r\n\t\tconst { pushHistory } = params as ExecuteParams;\r\n\t\tpushHistory?.({\r\n\t\t\tclear: true,\r\n\t\t\tisInput: false\r\n\t\t});\r\n\t\r\n\t\treturn { blank: true };\r\n\t});"],"names":["clear","Command","args","params","pushHistory"],"mappings":";AAEO,MAAMA,IAAQ,IAAIC,EAAQ,EAC/B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,aAAAC,EAAgB,IAAAD;AACV,SAAAC,KAAA,QAAAA,EAAA;AAAA,IACb,OAAO;AAAA,IACP,SAAS;AAAA,EAAA,IAGH,EAAE,OAAO;AACjB,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cmatrix-BRnwuwpQ.js","sources":["../src/core/commands/cmatrix.ts"],"sourcesContent":["import { Vector2 } from \"@prozilla-os/core\";\r\nimport { ANSI, randomFromArray, randomRange, removeFromArray } from \"@prozilla-os/shared\";\r\nimport { Command } from \"../command\";\r\nimport { Stream } from \"../stream\";\r\n\r\nconst ANIMATION_SPEED = 1.25;\r\nconst SCREEN_WIDTH = 75;\r\nconst SCREEN_HEIGHT = 20;\r\nconst CHARACTERS = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.*\\\\/()#@&$!?%°:<>[]\";\r\n\r\nconst PARTICLES = {\r\n\tframesBetweenSpawn: 30,\r\n\tfallSpeed: 1,\r\n\tminSize: 5,\r\n\tmaxSize: 25\r\n};\r\n\r\ntype Particle = {\r\n\tposition: Vector2,\r\n\tsize: number;\r\n};\r\n\r\nfunction generateScreen(frame: number, screen: string[][], particles: Particle[]): string {\r\n\t// Spawn new particles\r\n\tif (frame % PARTICLES.framesBetweenSpawn) {\r\n\t\tconst newParticle: Particle = {\r\n\t\t\tposition: new Vector2(randomRange(0, SCREEN_WIDTH), SCREEN_HEIGHT).round(),\r\n\t\t\tsize: Math.round(randomRange(PARTICLES.minSize, PARTICLES.maxSize))\r\n\t\t};\r\n\t\tparticles.push(newParticle);\r\n\t}\r\n\r\n\t// Move and render particles\r\n\tparticles.forEach((particle) => {\r\n\t\tparticle.position.y -= PARTICLES.fallSpeed;\r\n\r\n\t\t// Clean previous render\r\n\t\tfor (let i = 0; i < PARTICLES.fallSpeed; i++) {\r\n\t\t\tconst positionX = particle.position.x;\r\n\t\t\tconst positionY = particle.position.y + i + particle.size;\r\n\r\n\t\t\tif (positionY < SCREEN_HEIGHT && positionY >= 0)\r\n\t\t\t\tscreen[positionY][positionX] = \" \";\r\n\t\t}\r\n\r\n\t\t// Remove offscreen particles\r\n\t\tif (particle.position.y + particle.size <= 0 || particle.position.x >= SCREEN_WIDTH)\r\n\t\t\treturn removeFromArray(particle, particles);\r\n\r\n\t\tfor (let i = 0; i < particle.size; i++) {\r\n\t\t\tconst character = randomFromArray(CHARACTERS.split(\"\"));\r\n\t\t\tlet color = i == 0 ? ANSI.fg.white : ANSI.fg.green;\r\n\r\n\t\t\tif (i > particle.size / 2)\r\n\t\t\t\tcolor = ANSI.fg.green + ANSI.decoration.dim;\r\n\r\n\t\t\tconst positionX = particle.position.x;\r\n\t\t\tconst positionY = particle.position.y + i;\r\n\r\n\t\t\tif (positionX < SCREEN_WIDTH && positionY < SCREEN_HEIGHT && positionY >= 0) {\r\n\t\t\t\tscreen[positionY][positionX] = color + character + ANSI.reset;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\treturn [...screen.map((row) => row.join(\"\"))].reverse().join(\"\\n\");\r\n}\r\n\r\nexport const cmatrix = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Show a scrolling 'Matrix' like screen\",\r\n\t\tusage: \"cmatrix\",\r\n\t})\r\n\t.setExecute(function() {\r\n\t\tconst stream = new Stream();\r\n\t\tconst particles: Particle[] = [];\r\n\r\n\t\t// Create screen\r\n\t\tconst screen: string[][] = [];\r\n\t\tfor (let y = 0; y < SCREEN_HEIGHT; y++) {\r\n\t\t\tconst row: string[] = [];\r\n\t\t\tfor (let x = 0; x < SCREEN_WIDTH; x++) {\r\n\t\t\t\trow.push(\" \");\r\n\t\t\t}\r\n\t\t\tscreen.push(row);\r\n\t\t}\r\n\r\n\t\tlet frame = 0;\r\n\t\tconst interval = setInterval(() => {\r\n\t\t\tconst text = generateScreen(frame, screen, particles);\r\n\t\t\tstream.send(text);\r\n\t\t\tframe++;\r\n\t\t}, 100 / ANIMATION_SPEED);\r\n\r\n\t\tstream.on(Stream.EVENT_NAMES.stop, () => {\r\n\t\t\tclearInterval(interval);\r\n\t\t});\r\n\r\n\t\tstream.start();\r\n\r\n\t\treturn stream;\r\n\t});"],"names":["ANIMATION_SPEED","SCREEN_WIDTH","SCREEN_HEIGHT","CHARACTERS","PARTICLES","generateScreen","frame","screen","particles","newParticle","Vector2","randomRange","particle","i","positionX","positionY","removeFromArray","character","randomFromArray","color","ANSI","row","cmatrix","Command","stream","Stream","y","x","interval","text"],"mappings":";;;;AAKA,MAAMA,IAAkB,MAClBC,IAAe,IACfC,IAAgB,IAChBC,IAAa,sFAEbC,IAAY;AAAA,EACjB,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AACV;AAOA,SAASC,EAAeC,GAAeC,GAAoBC,GAA+B;AAErF,MAAAF,IAAQF,EAAU,oBAAoB;AACzC,UAAMK,IAAwB;AAAA,MAC7B,UAAU,IAAIC,EAAQC,EAAY,GAAGV,CAAY,GAAGC,CAAa,EAAE,MAAM;AAAA,MACzE,MAAM,KAAK,MAAMS,EAAYP,EAAU,SAASA,EAAU,OAAO,CAAC;AAAA,IAAA;AAEnE,IAAAI,EAAU,KAAKC,CAAW;AAAA,EAC3B;AAGU,SAAAD,EAAA,QAAQ,CAACI,MAAa;AACtB,IAAAA,EAAA,SAAS,KAAKR,EAAU;AAGjC,aAASS,IAAI,GAAGA,IAAIT,EAAU,WAAWS,KAAK;AACvC,YAAAC,IAAYF,EAAS,SAAS,GAC9BG,IAAYH,EAAS,SAAS,IAAIC,IAAID,EAAS;AAEjD,MAAAG,IAAYb,KAAiBa,KAAa,MACtCR,EAAAQ,CAAS,EAAED,CAAS,IAAI;AAAA,IACjC;AAGI,QAAAF,EAAS,SAAS,IAAIA,EAAS,QAAQ,KAAKA,EAAS,SAAS,KAAKX;AAC/D,aAAAe,EAAgBJ,GAAUJ,CAAS;AAE3C,aAASK,IAAI,GAAGA,IAAID,EAAS,MAAMC,KAAK;AACvC,YAAMI,IAAYC,EAAgBf,EAAW,MAAM,EAAE,CAAC;AACtD,UAAIgB,IAAQN,KAAK,IAAIO,EAAK,GAAG,QAAQA,EAAK,GAAG;AAEzC,MAAAP,IAAID,EAAS,OAAO,MACvBO,IAAQC,EAAK,GAAG,QAAQA,EAAK,WAAW;AAEnC,YAAAN,IAAYF,EAAS,SAAS,GAC9BG,IAAYH,EAAS,SAAS,IAAIC;AAExC,MAAIC,IAAYb,KAAgBc,IAAYb,KAAiBa,KAAa,MACzER,EAAOQ,CAAS,EAAED,CAAS,IAAIK,IAAQF,IAAYG,EAAK;AAAA,IAE1D;AAAA,EAAA,CACA,GAEM,CAAC,GAAGb,EAAO,IAAI,CAACc,MAAQA,EAAI,KAAK,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK;AAAA,CAAI;AAClE;AAEO,MAAMC,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACR,CAAC,EACA,WAAW,WAAW;AAChB,QAAAC,IAAS,IAAIC,KACbjB,IAAwB,CAAA,GAGxBD,IAAqB,CAAA;AAC3B,WAASmB,IAAI,GAAGA,IAAIxB,GAAewB,KAAK;AACvC,UAAML,IAAgB,CAAA;AACtB,aAASM,IAAI,GAAGA,IAAI1B,GAAc0B;AACjC,MAAAN,EAAI,KAAK,GAAG;AAEb,IAAAd,EAAO,KAAKc,CAAG;AAAA,EAChB;AAEA,MAAIf,IAAQ;AACN,QAAAsB,IAAW,YAAY,MAAM;AAClC,UAAMC,IAAOxB,EAAeC,GAAOC,GAAQC,CAAS;AACpD,IAAAgB,EAAO,KAAKK,CAAI,GAChBvB;AAAA,EAAA,GACE,MAAMN,CAAe;AAExB,SAAAwB,EAAO,GAAGC,EAAO,YAAY,MAAM,MAAM;AACxC,kBAAcG,CAAQ;AAAA,EAAA,CACtB,GAEDJ,EAAO,MAAM,GAENA;AACR,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-nBL1aO7T.js","sources":["../src/core/command.ts"],"sourcesContent":["import { App, SettingsManager, SystemManager, VirtualFolder, VirtualRoot } from \"@prozilla-os/core\";\r\nimport { Stream } from \"./stream\";\r\n\r\ntype Option = {\r\n\tlong: string,\r\n\tshort: string,\r\n\tisInput: boolean\r\n};\r\n\r\nexport type CommandResponse = string | { blank: boolean } | void | Stream;\r\nexport type ExecuteParams = {\r\n\tpromptOutput?: Function,\r\n\tpushHistory?: Function,\r\n\tvirtualRoot?: VirtualRoot,\r\n\tcurrentDirectory: VirtualFolder,\r\n\tsetCurrentDirectory?: Function,\r\n\tusername?: string,\r\n\thostname?: string,\r\n\trawInputValue?: string,\r\n\toptions?: string[],\r\n\texit?: Function,\r\n\tinputs?: Record<string, string>,\r\n\ttimestamp: number,\r\n\tsettingsManager: SettingsManager,\r\n\tsystemManager: SystemManager,\r\n\tapp: App,\r\n};\r\n\r\ntype Execute = (args?: string[], params?: ExecuteParams) => CommandResponse | Promise<CommandResponse>;\r\n\r\ntype Manual = {\r\n\tpurpose?: string,\r\n\tusage?: string,\r\n\tdescription?: string,\r\n\toptions?: object\r\n};\r\n\r\nexport class Command {\r\n\tname: string = \"command\";\r\n\toptions: Option[] = [];\r\n\tmanual: Manual | undefined;\r\n\trequireArgs: boolean | undefined;\r\n\trequireOptions: boolean | undefined;\r\n\r\n\texecute: Execute = () => {};\r\n\r\n\tsetName(name: string): Command {\r\n\t\tthis.name = name;\r\n\r\n\t\tif (!this.manual?.usage) {\r\n\t\t\tif (!this.manual)\r\n\t\t\t\tthis.manual = {};\r\n\r\n\t\t\tthis.manual.usage = name;\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetExecute(execute: Execute): Command {\r\n\t\tthis.execute = execute;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetRequireArgs(value: boolean): Command {\r\n\t\tthis.requireArgs = value;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetRequireOptions(value: boolean): Command {\r\n\t\tthis.requireOptions = value;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetManual({ purpose, usage, description, options }: Manual): Command {\r\n\t\tthis.manual = { purpose, usage, description, options };\r\n\t\treturn this;\r\n\t}\r\n\r\n\taddOption({ short, long, isInput }: Option): Command {\r\n\t\tthis.options.push({ short, long, isInput });\r\n\t\treturn this;\r\n\t}\r\n\r\n\tgetOption(key: string): Option | null {\r\n\t\tlet matchingOption: Option | null = null;\r\n\r\n\t\tthis.options.forEach((option) => {\r\n\t\t\tif (option.short === key || option.long === key)\r\n\t\t\t\tmatchingOption = option;\r\n\t\t});\r\n\r\n\t\treturn matchingOption;\r\n\t}\r\n}"],"names":["Command","__publicField","name","_a","execute","value","purpose","usage","description","options","short","long","isInput","key","matchingOption","option"],"mappings":";;;AAqCO,MAAMA,EAAQ;AAAA,EAAd;AACN,IAAAC,EAAA,cAAe;AACf,IAAAA,EAAA,iBAAoB,CAAA;AACpB,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAEA,IAAAA,EAAA,iBAAmB,MAAM;AAAA,IAAA;AAAA;AAAA,EAEzB,QAAQC,GAAuB;AATzB,QAAAC;AAUL,gBAAK,OAAOD,IAEPC,IAAA,KAAK,WAAL,QAAAA,EAAa,UACZ,KAAK,WACT,KAAK,SAAS,KAEf,KAAK,OAAO,QAAQD,IAGd;AAAA,EACR;AAAA,EAEA,WAAWE,GAA2B;AACrC,gBAAK,UAAUA,GACR;AAAA,EACR;AAAA,EAEA,eAAeC,GAAyB;AACvC,gBAAK,cAAcA,GACZ;AAAA,EACR;AAAA,EAEA,kBAAkBA,GAAyB;AAC1C,gBAAK,iBAAiBA,GACf;AAAA,EACR;AAAA,EAEA,UAAU,EAAE,SAAAC,GAAS,OAAAC,GAAO,aAAAC,GAAa,SAAAC,KAA4B;AACpE,gBAAK,SAAS,EAAE,SAAAH,GAAS,OAAAC,GAAO,aAAAC,GAAa,SAAAC,KACtC;AAAA,EACR;AAAA,EAEA,UAAU,EAAE,OAAAC,GAAO,MAAAC,GAAM,SAAAC,KAA4B;AACpD,gBAAK,QAAQ,KAAK,EAAE,OAAAF,GAAO,MAAAC,GAAM,SAAAC,GAAS,GACnC;AAAA,EACR;AAAA,EAEA,UAAUC,GAA4B;AACrC,QAAIC,IAAgC;AAE/B,gBAAA,QAAQ,QAAQ,CAACC,MAAW;AAChC,OAAIA,EAAO,UAAUF,KAAOE,EAAO,SAASF,OAC1BC,IAAAC;AAAA,IAAA,CAClB,GAEMD;AAAA,EACR;AACD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compgen-DwiJvEym.js","sources":["../src/core/commands/compgen.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\r\nimport { CommandsManager } from \"../commands\";\r\n\r\nexport const compgen = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Display a list of all commands\"\r\n\t})\r\n\t.setRequireOptions(true)\r\n\t.setExecute(function(args, params) {\r\n\t\tconst { options } = params as ExecuteParams;\r\n\t\tif (options?.includes(\"c\")) {\r\n\t\t\treturn CommandsManager.COMMANDS.map((command) => command.name).sort().join(\"\\n\");\r\n\t\t}\r\n\t});"],"names":["compgen","Command","args","params","options","CommandsManager","command"],"mappings":";;AAGO,MAAMA,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,kBAAkB,EAAI,EACtB,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,SAAAC,EAAY,IAAAD;AAChB,MAAAC,KAAA,QAAAA,EAAS,SAAS;AACd,WAAAC,EAAgB,SAAS,IAAI,CAACC,MAAYA,EAAQ,IAAI,EAAE,KAAA,EAAO,KAAK;AAAA,CAAI;AAEjF,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cowsay-BzvDA7zo.js","sources":["../src/core/commands/cowsay.ts"],"sourcesContent":["import { MAX_WIDTH } from \"../../constants/terminal.const\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\n\r\nconst COW = `\r\n \\\\ ^__^\r\n \\\\ (oo)\\\\_______\r\n (__)\\\\ )\\\\/\\\\\r\n ||----w |\r\n || ||`;\r\n\r\nexport const cowsay = new Command()\r\n\t.setRequireArgs(true)\r\n\t.setManual({\r\n\t\tpurpose: \"Show a cow saying something\",\r\n\t\tusage: \"cowsay text\",\r\n\t\tdescription: \"Show ASCII art of a cow saying something.\"\r\n\t})\r\n\t.setExecute(function(args, params) {\r\n\t\tconst { rawInputValue } = params as ExecuteParams;\r\n\r\n\t\t// Separate input value into lines\r\n\t\tconst segments = rawInputValue?.split(\" \");\r\n\t\tconst lines: string[] = [];\r\n\t\tlet currentLine = \"\";\r\n\t\tlet maxLineWidth = 0;\r\n\r\n\t\tconst addLine = (line: string) => {\r\n\t\t\tline = line.trimEnd();\r\n\t\t\tlines.push(line);\r\n\t\t\tif (line.length > maxLineWidth)\r\n\t\t\t\tmaxLineWidth = line.length;\r\n\t\t};\r\n\r\n\t\tconst nextLine = (word?: string) => {\r\n\t\t\taddLine(currentLine);\r\n\r\n\t\t\tif (word) {\r\n\t\t\t\tcurrentLine = word + \" \";\r\n\t\t\t} else {\r\n\t\t\t\tcurrentLine = \"\";\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tsegments?.forEach((segment) => {\r\n\t\t\t// Add empty spaces preceding lines\r\n\t\t\tif (segment === \"\") {\r\n\t\t\t\tcurrentLine += \" \";\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst words = segment.split(\"\\n\");\r\n\t\t\tfor (let i = 0; i < words.length; i++) {\r\n\t\t\t\tconst word = words[i];\r\n\t\t\t\t\r\n\t\t\t\t// Handle next lines\r\n\t\t\t\tif (i > 0)\r\n\t\t\t\t\tnextLine();\r\n\r\n\t\t\t\t// Fit word on current line\r\n\t\t\t\tif ((currentLine + word).length <= MAX_WIDTH) {\r\n\t\t\t\t\tcurrentLine += word + \" \";\r\n\t\t\t\t} else if (word.length > MAX_WIDTH) {\r\n\t\t\t\t\tconst remainingSpaces = MAX_WIDTH - currentLine.length;\r\n\r\n\t\t\t\t\tif (remainingSpaces >= 2) {\r\n\t\t\t\t\t\taddLine(currentLine + word.substring(0, remainingSpaces - 1) + \"-\");\r\n\t\t\t\t\t\tcurrentLine = word.substring(remainingSpaces - 1) + \" \";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnextLine(word);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnextLine(word);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (currentLine.length > 0)\r\n\t\t\taddLine(currentLine);\r\n\r\n\t\t// Turn lines into speech bubble\r\n\t\tconst speechBubble = [` ${\"_\".repeat(maxLineWidth + 2)} `];\r\n\r\n\t\tfor (let i = 0; i < lines.length; i++) {\r\n\t\t\tlet line = lines[i];\r\n\t\t\tconst missingSpaces = maxLineWidth - line.length;\r\n\r\n\t\t\tif (missingSpaces > 0)\r\n\t\t\t\tline += \" \".repeat(missingSpaces);\r\n\r\n\t\t\tif (lines.length > 1) {\r\n\t\t\t\tif (i === 0) {\r\n\t\t\t\t\tline = `/ ${line} \\\\`;\r\n\t\t\t\t} else if (i === lines.length - 1) {\r\n\t\t\t\t\tline = `\\\\ ${line} /`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tline = `| ${line} |`;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tline = `< ${line} >`;\r\n\t\t\t}\r\n\r\n\t\t\tspeechBubble.push(line);\r\n\t\t}\r\n\r\n\t\tspeechBubble.push(` ${\"-\".repeat(maxLineWidth + 2)} `);\r\n\r\n\t\treturn speechBubble.join(\"\\n\") + COW;\r\n\t});"],"names":["COW","cowsay","Command","args","params","rawInputValue","segments","lines","currentLine","maxLineWidth","addLine","line","nextLine","word","segment","words","i","MAX_WIDTH","remainingSpaces","speechBubble","missingSpaces"],"mappings":";;AAGA,MAAMA,IAAM;AAAA;AAAA;AAAA;AAAA;AAAA,4BAOCC,IAAS,IAAIC,IACxB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,eAAAC,EAAkB,IAAAD,GAGpBE,IAAWD,KAAA,gBAAAA,EAAe,MAAM,MAChCE,IAAkB,CAAA;AACxB,MAAIC,IAAc,IACdC,IAAe;AAEb,QAAAC,IAAU,CAACC,MAAiB;AACjC,IAAAA,IAAOA,EAAK,WACZJ,EAAM,KAAKI,CAAI,GACXA,EAAK,SAASF,MACjBA,IAAeE,EAAK;AAAA,EAAA,GAGhBC,IAAW,CAACC,MAAkB;AACnC,IAAAH,EAAQF,CAAW,GAEfK,IACHL,IAAcK,IAAO,MAEPL,IAAA;AAAA,EACf;AAGS,EAAAF,KAAA,QAAAA,EAAA,QAAQ,CAACQ,MAAY;AAE9B,QAAIA,MAAY,IAAI;AACJ,MAAAN,KAAA;AACf;AAAA,IACD;AAEM,UAAAO,IAAQD,EAAQ,MAAM;AAAA,CAAI;AAChC,aAASE,IAAI,GAAGA,IAAID,EAAM,QAAQC,KAAK;AAChC,YAAAH,IAAOE,EAAMC,CAAC;AAOf,UAJDA,IAAI,KACEJ,MAGLJ,IAAcK,GAAM,UAAUI;AAClC,QAAAT,KAAeK,IAAO;AAAA,eACZA,EAAK,SAASI,GAAW;AAC7B,cAAAC,IAAkBD,IAAYT,EAAY;AAEhD,QAAIU,KAAmB,KACtBR,EAAQF,IAAcK,EAAK,UAAU,GAAGK,IAAkB,CAAC,IAAI,GAAG,GAClEV,IAAcK,EAAK,UAAUK,IAAkB,CAAC,IAAI,OAEpDN,EAASC,CAAI;AAAA,MACd;AAEA,QAAAD,EAASC,CAAI;AAAA,IAEf;AAAA,EAAA,IAGGL,EAAY,SAAS,KACxBE,EAAQF,CAAW;AAGd,QAAAW,IAAe,CAAC,IAAI,IAAI,OAAOV,IAAe,CAAC,CAAC,GAAG;AAEzD,WAASO,IAAI,GAAGA,IAAIT,EAAM,QAAQS,KAAK;AAClC,QAAAL,IAAOJ,EAAMS,CAAC;AACZ,UAAAI,IAAgBX,IAAeE,EAAK;AAE1C,IAAIS,IAAgB,MACXT,KAAA,IAAI,OAAOS,CAAa,IAE7Bb,EAAM,SAAS,IACdS,MAAM,IACTL,IAAO,KAAKA,CAAI,QACNK,MAAMT,EAAM,SAAS,IAC/BI,IAAO,MAAMA,CAAI,OAEjBA,IAAO,KAAKA,CAAI,OAGjBA,IAAO,KAAKA,CAAI,MAGjBQ,EAAa,KAAKR,CAAI;AAAA,EACvB;AAEA,SAAAQ,EAAa,KAAK,IAAI,IAAI,OAAOV,IAAe,CAAC,CAAC,GAAG,GAE9CU,EAAa,KAAK;AAAA,CAAI,IAAInB;AAClC,CAAC;"}
|
package/dist/dir-BlrznBqV.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dir-BlrznBqV.js","sources":["../src/core/commands/dir.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const dir = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"List all directories in the current directory\"\r\n\t})\r\n\t.setExecute(function(args, params) {\r\n\t\tconst { currentDirectory } = params as ExecuteParams;\r\n\t\tconst folderNames = currentDirectory.subFolders.map((folder) => folder.id);\r\n\t\r\n\t\tif (folderNames.length === 0)\r\n\t\t\treturn { blank: true };\r\n\t\r\n\t\treturn folderNames.sort((nameA, nameB) => nameA.localeCompare(nameB)).join(\" \");\r\n\t});"],"names":["dir","Command","args","params","currentDirectory","folderNames","folder","nameA","nameB"],"mappings":";AAEO,MAAMA,IAAM,IAAIC,EAAQ,EAC7B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,kBAAAC,EAAqB,IAAAD,GACvBE,IAAcD,EAAiB,WAAW,IAAI,CAACE,MAAWA,EAAO,EAAE;AAEzE,SAAID,EAAY,WAAW,IACnB,EAAE,OAAO,OAEVA,EAAY,KAAK,CAACE,GAAOC,MAAUD,EAAM,cAAcC,CAAK,CAAC,EAAE,KAAK,GAAG;AAC/E,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"echo-PyZ6XYF6.js","sources":["../src/core/commands/echo.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const echo = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Display text on the terminal screen\"\r\n\t})\r\n\t.setExecute(function(args, params) {\r\n\t\tconst { rawInputValue } = params as ExecuteParams;\r\n\t\treturn rawInputValue;\r\n\t});"],"names":["echo","Command","args","params","rawInputValue"],"mappings":";AAEO,MAAMA,IAAO,IAAIC,EAAQ,EAC9B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,eAAAC,EAAkB,IAAAD;AACnB,SAAAC;AACR,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eval-CnKC-mrj.js","sources":["../src/core/commands/eval.ts"],"sourcesContent":["import { Command, CommandResponse } from \"../command\";\r\n\r\nconst evalCommand = new Command()\r\n\t.setRequireArgs(true)\r\n\t.setManual({\r\n\t\tpurpose: \"Evaluate and execute JavaScript code\",\r\n\t\tusage: \"eval [input]\",\r\n\t})\r\n\t.setRequireArgs(true)\r\n\t.setExecute(function(this: Command, args) {\r\n\t\tif (args == null || args.length == 0)\r\n\t\t\treturn;\r\n\t\t\r\n\t\tconst output = eval(args[0]) as CommandResponse ?? { blank: true };\r\n\t\treturn output;\r\n\t});\r\n\r\nexport { evalCommand as eval };"],"names":[],"mappings":";AAEA,MAAM,cAAc,IAAI,UACtB,eAAe,EAAI,EACnB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACR,CAAC,EACA,eAAe,EAAI,EACnB,WAAW,SAAwB,MAAM;AACrC,MAAA,QAAQ,QAAQ,KAAK,UAAU;AAClC;AAEK,QAAA,SAAS,KAAK,KAAK,CAAC,CAAC,KAAwB,EAAE,OAAO;AACrD,SAAA;AACR,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exit-CizX3N_u.js","sources":["../src/core/commands/exit.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const exit = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Quit terminal interface\"\r\n\t})\r\n\t.setExecute(function(args, params) {\r\n\t\tconst { exit } = params as ExecuteParams;\r\n\t\texit?.();\r\n\t\treturn { blank: true };\r\n\t});"],"names":["exit","Command","args","params"],"mappings":";AAEO,MAAMA,IAAO,IAAIC,EAAQ,EAC9B,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,MAAAH,EAAS,IAAAG;AACjBH,SAAAA,KAAAA,QAAAA,KACO,EAAE,OAAO;AACjB,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fortune-Cs0PtMgs.js","sources":["../src/core/commands/fortune.ts"],"sourcesContent":["import { randomFromArray } from \"@prozilla-os/shared\";\r\nimport { Command } from \"../command\";\r\n\r\n/**\r\n * Source: https://github.com/shlomif/fortune-mod/blob/master/fortune-mod/datfiles/fortunes\r\n */\r\nconst FORTUNES = [\r\n\t\"Do not be afraid of competition.\",\r\n\t\"An exciting opportunity lies ahead of you.\",\r\n\t\"You love peace.\",\r\n\t\"Get your mind set... confidence will lead you on.\",\r\n\t\"You will always be surrounded by true friends.\",\r\n\t\"Sell your ideas-they have exceptional merit.\",\r\n\t\"You should be able to undertake and complete anything.\",\r\n\t\"You are kind and friendly.\",\r\n\t\"You are wise beyond your years.\",\r\n\t\"Your ability to juggle many tasks will take you far.\",\r\n\t\"A routine task will turn into an enchanting adventure.\",\r\n\t\"Beware of all enterprises that require new clothes.\",\r\n\t\"Be true to your work, your word, and your friend.\",\r\n\t\"Goodness is the only investment that never fails.\",\r\n\t\"A journey of a thousand miles begins with a single step.\",\r\n\t\"Forget injuries; never forget kindnesses.\",\r\n\t\"Respect yourself and others will respect you.\",\r\n\t\"A man cannot be comfortable without his own approval.\",\r\n\t\"Always do right. This will gratify some people and astonish the rest.\",\r\n\t\"It is easier to stay out than to get out.\",\r\n\t\"Sing everyday and chase the mean blues away.\",\r\n\t\"You will receive money from an unexpected source.\",\r\n\t\"Attitude is a little thing that makes a big difference.\",\r\n\t\"Plan for many pleasures ahead.\",\r\n\t\"Experience is the best teacher.\",\r\n\t\"You will be happy with your spouse.\",\r\n\t\"Expect the unexpected.\",\r\n\t\"Stay healthy. Walk a mile.\",\r\n\t\"The family that plays together stays together.\",\r\n\t\"Eat chocolate to have a sweeter life.\",\r\n\t\"Once you make a decision the universe conspires to make it happen.\",\r\n\t\"Make yourself necessary to someone.\",\r\n\t\"The only way to have a friend is to be one.\",\r\n\t\"Nothing great was ever achieved without enthusiasm.\",\r\n\t\"Dance as if no one is watching.\",\r\n\t\"Live this day as if it were your last.\",\r\n\t\"Your life will be happy and peaceful.\",\r\n\t\"Reach for joy and all else will follow.\",\r\n\t\"Move in the direction of your dreams.\",\r\n\t\"Bloom where you are planted.\",\r\n\t\"Appreciate. Appreciate. Appreciate.\",\r\n\t\"Happy News is on its way.\",\r\n\t\"A closed mouth gathers no feet.\",\r\n\t\"He who throws dirt is losing ground.\",\r\n\t\"Borrow money from a pessimist. They don't expect it back.\",\r\n\t\"Life is what happens to you while you are busy making other plans.\",\r\n\t\"Help! I'm being held prisoner in a fortune cookie factory.\",\r\n];\r\n\r\nexport const fortune = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Tell fortune\"\r\n\t})\r\n\t.setExecute(function() {\r\n\t\treturn randomFromArray(FORTUNES);\r\n\t});"],"names":["FORTUNES","fortune","Command","randomFromArray"],"mappings":";;AAMA,MAAMA,IAAW;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAEaC,IAAU,IAAIC,EAAQ,EACjC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,WAAW;AACtB,SAAOC,EAAgBH,CAAQ;AAChC,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help-VUVj2BCL.js","sources":["../src/core/commands/help.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command } from \"../command\";\r\nimport { CommandsManager } from \"../commands\";\r\n\r\nexport const help = new Command()\r\n\t.setExecute(function(this: Command, args) {\r\n\t\tif (args?.length === 0) {\r\n\t\t\treturn CommandsManager.COMMANDS.map((command) => {\r\n\t\t\t\tif (command.manual?.purpose) {\r\n\t\t\t\t\treturn `${command.name} - ${ANSI.fg.green}${ANSI.decoration.dim}${command.manual.purpose}${ANSI.reset}`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn command.name;\r\n\t\t\t\t}\r\n\t\t\t}).sort().join(\"\\n\");\r\n\t\t}\r\n\r\n\t\tconst commandName = (args as string[])[0].toLowerCase();\r\n\t\tconst command = CommandsManager.find(commandName);\r\n\r\n\t\tif (!command)\r\n\t\t\treturn formatError(this.name, `${commandName}: Command not found`);\r\n\r\n\t\tif (!command.manual?.purpose)\r\n\t\t\treturn formatError(this.name, `${commandName}: No manual found`);\r\n\r\n\t\treturn command.manual.purpose;\r\n\t});"],"names":["help","Command","args","CommandsManager","command","ANSI","commandName","_a","formatError"],"mappings":";;;AAKO,MAAMA,IAAO,IAAIC,EAAA,EACtB,WAAW,SAAwBC,GAAM;;AACrC,OAAAA,KAAA,gBAAAA,EAAM,YAAW;AACpB,WAAOC,EAAgB,SAAS,IAAI,CAACC,MAAY;;AAC5CA,cAAAA,IAAAA,EAAQ,WAARA,QAAAA,EAAgB,UACX,GAAGA,EAAQ,IAAI,MAAMC,EAAK,GAAG,KAAK,GAAGA,EAAK,WAAW,GAAG,GAAGD,EAAQ,OAAO,OAAO,GAAGC,EAAK,KAAK,KAE/FD,EAAQ;AAAA,IAEhB,CAAA,EAAE,KAAK,EAAE,KAAK;AAAA,CAAI;AAGpB,QAAME,IAAeJ,EAAkB,CAAC,EAAE,YAAY,GAChDE,IAAUD,EAAgB,KAAKG,CAAW;AAEhD,SAAKF,KAGAG,IAAAH,EAAQ,WAAR,QAAAG,EAAgB,UAGdH,EAAQ,OAAO,UAFdI,EAAY,KAAK,MAAM,GAAGF,CAAW,mBAAmB,IAHxDE,EAAY,KAAK,MAAM,GAAGF,CAAW,qBAAqB;AAMnE,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hostname-BBOQWx6L.js","sources":["../src/core/commands/hostname.ts"],"sourcesContent":["import { Command, ExecuteParams } from \"../command\";\r\n\r\nexport const hostname = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Display the hostname\"\r\n\t})\r\n\t.setExecute(function(args, params) {\r\n\t\tconst { hostname } = params as ExecuteParams;\r\n\t\treturn hostname;\r\n\t});"],"names":["hostname","Command","args","params"],"mappings":";AAEO,MAAMA,IAAW,IAAIC,EAAQ,EAClC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,UAAAH,EAAa,IAAAG;AACdH,SAAAA;AACR,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lolcat-Bqd7OWmj.js","sources":["../src/core/commands/lolcat.ts"],"sourcesContent":["import { ANSI } from \"@prozilla-os/shared\";\r\nimport { removeAnsi } from \"../_utils/terminal.utils\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\n\r\nconst COLUMN_WIDTH = 5;\r\nconst ROW_OFFSET = 2;\r\n\r\nconst RAINBOW = [\r\n\tANSI.fg.red,\r\n\tANSI.fg.yellow,\r\n\tANSI.fg.green,\r\n\tANSI.fg.cyan,\r\n\tANSI.fg.blue,\r\n\tANSI.fg.magenta,\r\n];\r\n\r\nexport const lolcat = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"Display text with a rainbow effect\"\r\n\t})\r\n\t.setExecute(function(args, params) {\r\n\t\tconst { rawInputValue, timestamp } = params as ExecuteParams;\r\n\t\tif (rawInputValue == null) return;\r\n\t\tlet rows = removeAnsi(rawInputValue).split(\"\\n\");\r\n\t\tconst offset = timestamp / 100;\r\n\r\n\t\trows = rows.map((row, index) => {\r\n\t\t\tconst columns: string[] = [];\r\n\r\n\t\t\tconst rowIndex = index + offset;\r\n\t\t\tconst rowOffset = COLUMN_WIDTH - ((ROW_OFFSET * rowIndex) % COLUMN_WIDTH);\r\n\t\t\tlet rainbowIndex = Math.floor(rowIndex / (COLUMN_WIDTH / ROW_OFFSET));\r\n\r\n\t\t\tconst addColumn = (start: number, end: number) => {\r\n\t\t\t\tconst column = row.substring(start, end);\r\n\t\t\t\tconst color = RAINBOW[rainbowIndex++ % RAINBOW.length];\r\n\t\t\t\tcolumns.push(color + column);\r\n\t\t\t};\r\n\r\n\t\t\tif (rowOffset > 0)\r\n\t\t\t\taddColumn(0, rowOffset);\r\n\t\r\n\t\t\tfor (let i = rowOffset; i < row.length; i += COLUMN_WIDTH + 1) {\r\n\t\t\t\taddColumn(i, i + COLUMN_WIDTH + 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (row.length === 0)\r\n\t\t\t\treturn \"\";\r\n\r\n\t\t\treturn columns.join(\"\");\r\n\t\t});\r\n\r\n\t\treturn rows.join(\"\\n\");\r\n\t});"],"names":["COLUMN_WIDTH","ROW_OFFSET","RAINBOW","ANSI","lolcat","Command","args","params","rawInputValue","timestamp","rows","removeAnsi","offset","row","index","columns","rowIndex","rowOffset","rainbowIndex","addColumn","start","end","column","color","i"],"mappings":";;;AAIA,MAAMA,IAAe,GACfC,IAAa,GAEbC,IAAU;AAAA,EACfC,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AAAA,EACRA,EAAK,GAAG;AACT,GAEaC,IAAS,IAAIC,EAAQ,EAChC,UAAU;AAAA,EACV,SAAS;AACV,CAAC,EACA,WAAW,SAASC,GAAMC,GAAQ;AAC5B,QAAA,EAAE,eAAAC,GAAe,WAAAC,EAAc,IAAAF;AACrC,MAAIC,KAAiB,KAAM;AAC3B,MAAIE,IAAOC,EAAWH,CAAa,EAAE,MAAM;AAAA,CAAI;AAC/C,QAAMI,IAASH,IAAY;AAE3B,SAAAC,IAAOA,EAAK,IAAI,CAACG,GAAKC,MAAU;AAC/B,UAAMC,IAAoB,CAAA,GAEpBC,IAAWF,IAAQF,GACnBK,IAAYjB,IAAiBC,IAAae,IAAYhB;AAC5D,QAAIkB,IAAe,KAAK,MAAMF,KAAYhB,IAAeC,EAAW;AAE9D,UAAAkB,IAAY,CAACC,GAAeC,MAAgB;AACjD,YAAMC,IAAST,EAAI,UAAUO,GAAOC,CAAG,GACjCE,IAAQrB,EAAQgB,MAAiBhB,EAAQ,MAAM;AAC7C,MAAAa,EAAA,KAAKQ,IAAQD,CAAM;AAAA,IAAA;AAG5B,IAAIL,IAAY,KACfE,EAAU,GAAGF,CAAS;AAEvB,aAASO,IAAIP,GAAWO,IAAIX,EAAI,QAAQW,KAAKxB,IAAe;AACjD,MAAAmB,EAAAK,GAAGA,IAAIxB,IAAe,CAAC;AAGlC,WAAIa,EAAI,WAAW,IACX,KAEDE,EAAQ,KAAK,EAAE;AAAA,EAAA,CACtB,GAEML,EAAK,KAAK;AAAA,CAAI;AACtB,CAAC;"}
|
package/dist/ls-CVAvyBf2.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ls-CVAvyBf2.js","sources":["../src/core/commands/ls.ts"],"sourcesContent":["import { VirtualFolder } from \"@prozilla-os/core\";\r\nimport { formatError } from \"../_utils/terminal.utils\";\r\nimport { Command, ExecuteParams } from \"../command\";\r\nimport { ANSI } from \"@prozilla-os/shared\";\r\n\r\nexport const ls = new Command()\r\n\t.setManual({\r\n\t\tpurpose: \"List directory contents\",\r\n\t\tusage: \"ls [options] [files]\",\r\n\t\tdescription: \"List information about directories or files (the current directory by default).\"\r\n\t})\r\n\t.setExecute(function(this: Command, args, params) {\r\n\t\tconst { currentDirectory } = params as ExecuteParams;\r\n\t\tlet directory = currentDirectory;\r\n\t\r\n\t\tif (args != null && args.length > 0) {\r\n\t\t\tdirectory = currentDirectory.navigate((args)[0]) as VirtualFolder;\r\n\t\t}\r\n\t\r\n\t\tif (!directory)\r\n\t\t\treturn formatError(this.name, `Cannot access '${(args as string[])[0]}': No such file or directory`);\r\n\t\r\n\t\tconst folderNames = directory.subFolders.map((folder) => `${ANSI.fg.blue}${folder.id}${ANSI.reset}`);\r\n\t\tconst fileNames = directory.files.map((file) => file.id);\r\n\t\r\n\t\tconst contents = folderNames.concat(fileNames);\r\n\t\r\n\t\tif (contents.length === 0)\r\n\t\t\treturn { blank: true };\r\n\t\r\n\t\treturn contents.sort().join(\" \");\r\n\t});"],"names":["ls","Command","args","params","currentDirectory","directory","formatError","folderNames","folder","ANSI","fileNames","file","contents"],"mappings":";;;AAKO,MAAMA,IAAK,IAAIC,EAAQ,EAC5B,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACd,CAAC,EACA,WAAW,SAAwBC,GAAMC,GAAQ;AAC3C,QAAA,EAAE,kBAAAC,EAAqB,IAAAD;AAC7B,MAAIE,IAAYD;AAMhB,MAJIF,KAAQ,QAAQA,EAAK,SAAS,MACjCG,IAAYD,EAAiB,SAAUF,EAAM,CAAC,CAAC,IAG5C,CAACG;AACJ,WAAOC,EAAY,KAAK,MAAM,kBAAmBJ,EAAkB,CAAC,CAAC,8BAA8B;AAEpG,QAAMK,IAAcF,EAAU,WAAW,IAAI,CAACG,MAAW,GAAGC,EAAK,GAAG,IAAI,GAAGD,EAAO,EAAE,GAAGC,EAAK,KAAK,EAAE,GAC7FC,IAAYL,EAAU,MAAM,IAAI,CAACM,MAASA,EAAK,EAAE,GAEjDC,IAAWL,EAAY,OAAOG,CAAS;AAE7C,SAAIE,EAAS,WAAW,IAChB,EAAE,OAAO,OAEVA,EAAS,KAAA,EAAO,KAAK,IAAI;AACjC,CAAC;"}
|