sync: sync wip stuff
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import type { Item } from '../fs/Item'
|
||||
import type { SimpleStream } from '../utils/SimpleStream'
|
||||
import { Program } from './Program'
|
||||
|
||||
export class Eval extends Program {
|
||||
async Exec(_: SimpleStream<string>, stdout: SimpleStream<string>, args: string[]): Promise<number> {
|
||||
async Exec(_: SimpleStream<string>, stdout: SimpleStream<string>, _workdir: Item, args: string[]): Promise<number> {
|
||||
const javascript = args.slice(1).join(' ')
|
||||
|
||||
try {
|
||||
// todo: pass workdir to the program
|
||||
eval(javascript)
|
||||
} catch (e) {
|
||||
stdout.emit(`${String(e)}\n`)
|
||||
|
||||
Reference in New Issue
Block a user