소스 검색

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

Sam Atkins 1 년 전
부모
커밋
8f1c4fcda9
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      packages/phoenix/src/puter-shell/providers/PuterAppCommandProvider.js

+ 7 - 2
packages/phoenix/src/puter-shell/providers/PuterAppCommandProvider.js

@@ -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.