sync: wip shell and info fetch

This commit is contained in:
2026-03-27 17:52:58 +01:00
parent 83830c7717
commit ea968b8492
6 changed files with 59 additions and 40 deletions

25
src/program/Info.ts Normal file
View File

@@ -0,0 +1,25 @@
import type { SimpleStream } from '../utils/SimpleStream'
import { Program } from './Program'
export class Info extends Program {
async Exec(_: SimpleStream<string>, stdout: SimpleStream<string>, __: string[]): Promise<number> {
const art = `++++++++++++++++++++++++++++++\n++++++++++++++++++++++++++++++\n++++++++++++++++++++++++++++++\n++++++++++++++++++++++++++++++\n++++++++++++++++++++++++++++++\n++++++++++++++++++++++++++++++\n+++++++++++++++++++++;..:+++++\n++++ ++ +++\n++++++++. +++++ +++++++++\n++++++++. +++++: ++++++++\n++++++++. ++++++; ++++\n++++++++. ++++++++++. +++\n++++++++. +++++.++++++ ;++\n++++++++. +++++ +++\n++++++++;...++++++; ;+++++\n++++++++++++++++++++++++++++++`
const modules = [
{ text: "" },
{ text: "" },
{ text: "" },
{ text: "" },
{ text: "" },
]
const lines = art.split("\n")
const padding = Math.floor((lines.length - modules.length) / 2)
lines.forEach((line, i) => {
stdout.emit(`${line}${i + 1 > padding && i + 1 < ? 'hm' : ''}\n`)
})
return 0
}
}

View File

@@ -1,29 +0,0 @@
import type { SimpleStream } from '../utils/SimpleStream'
import { Program } from './Program'
export class Neofetch extends Program {
async Exec(_: SimpleStream<string>, stdout: SimpleStream<string>, __: string[]): Promise<number> {
const art = `++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++
+++++++++++++++++++++;..:+++++
++++ ++ +++
++++++++. +++++ +++++++++
++++++++. +++++: ++++++++
++++++++. ++++++; ++++
++++++++. ++++++++++. +++
++++++++. +++++.++++++ ;++
++++++++. +++++ +++
++++++++;...++++++; ;+++++
++++++++++++++++++++++++++++++`
art.split("\n").forEach(line => {
stdout.emit(`${line}\n`)
})
return 0
}
}