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, stdout: SimpleStream, __: Item, ___: string[]): Promise { 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 } }