feat(Phoenix): Pass command line arguments and ENV when launching apps

This commit is contained in:
Sam Atkins 2024-05-15 11:31:00 +01:00
parent bf33fd752d
commit 8f1c4fcda9

View File

@ -50,9 +50,14 @@ export class PuterAppCommandProvider {
return {
name: id,
path: path ?? 'Built-in Puter app',
// TODO: Parameters and options?
// TODO: Let apps expose option/positional definitions like builtins do, and parse them here?
async execute(ctx) {
const args = {}; // TODO: Passed-in parameters and options would go here
const args = {
command_line: {
args: ctx.locals.args,
},
env: {...ctx.env},
};
const child = await puter.ui.launchApp(id, args);
// Wait for app to close.