File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,7 +207,11 @@ export const TuiThreadCommand = cmd({
207207 }
208208 const cwd = Filesystem . resolve ( process . cwd ( ) )
209209
210- const worker = new Worker ( file )
210+ const worker = new Worker ( file , {
211+ env : Object . fromEntries (
212+ Object . entries ( process . env ) . filter ( ( entry ) : entry is [ string , string ] => entry [ 1 ] !== undefined ) ,
213+ ) ,
214+ } )
211215 const client = Rpc . client < typeof rpc > ( worker )
212216 const reload = ( ) => {
213217 client . call ( "reload" , undefined ) . catch ( ( ) => { } )
Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ describe("tui thread", () => {
1616 expect ( source ) . not . toContain ( 'import("./app")' )
1717 } )
1818
19+ test ( "forwards the CLI environment to the TUI worker" , async ( ) => {
20+ const source = await Bun . file ( new URL ( "../../../src/cli/cmd/tui.ts" , import . meta. url ) ) . text ( )
21+
22+ expect ( source ) . toMatch ( / n e w W o r k e r \( f i l e , \{ \s * e n v : O b j e c t \. f r o m E n t r i e s \( \s * O b j e c t \. e n t r i e s \( p r o c e s s \. e n v \) / )
23+ } )
24+
1925 async function check ( project ?: string ) {
2026 await using tmp = await tmpdir ( { git : true } )
2127 const link = path . join ( path . dirname ( tmp . path ) , path . basename ( tmp . path ) + "-link" )
You can’t perform that action at this time.
0 commit comments