sync: wip shell and info fetch
This commit is contained in:
25
src/program/Info.ts
Normal file
25
src/program/Info.ts
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user