20 lines
805 B
TypeScript
20 lines
805 B
TypeScript
import { GetCurrentTerminal, WEBSHELL_VERSION, VERSION_COMMENT } from '../app'
|
|
import type { Item } from '../fs/Item'
|
|
import { Terminal } from '../terminal/Terminal'
|
|
import type { SimpleStream } from '../utils/SimpleStream'
|
|
import { Program } from './Program'
|
|
|
|
export class Info extends Program {
|
|
async Exec(_: SimpleStream<string>, stdout: SimpleStream<string>, __: Item, ___: string[]): Promise<number> {
|
|
stdout.emit(`Webshell v${WEBSHELL_VERSION}\n`)
|
|
stdout.emit(`Terminal v${Terminal.Version}\n`)
|
|
stdout.emit(`Running ${GetCurrentTerminal().GetShell()?.Name} v${GetCurrentTerminal().GetShell()?.Version}\n`)
|
|
|
|
// print a comment for the current release if any
|
|
if (VERSION_COMMENT)
|
|
stdout.emit(`-> ${VERSION_COMMENT}\n`)
|
|
|
|
return 0
|
|
}
|
|
}
|