@@ -95,34 +95,37 @@ const layerTest = (input: {
9595 ) ;
9696} ;
9797
98- it . effect ( "opens home-relative app bundles using the server home directory" , ( ) =>
99- Effect . gen ( function * ( ) {
100- const fs = yield * FileSystem . FileSystem ;
101- const path = yield * Path . Path ;
102- const bin = yield * fs . makeTempDirectoryScoped ( { prefix : "t3-app-open-" } ) ;
103- yield * fs . writeFileString ( path . join ( bin , "open" ) , "#!/bin/sh\n" ) ;
104- yield * fs . chmod ( path . join ( bin , "open" ) , 0o755 ) ;
105- const spawned : ChildProcess . StandardCommand [ ] = [ ] ;
106- yield * Effect . gen ( function * ( ) {
107- const launcher = yield * ExternalLauncher . ExternalLauncher ;
108- for ( const cwd of [ "~/Applications/My App.app" , "/Applications/My App.app" ] ) {
109- yield * launcher . launchEditor ( { editor : "file-manager" , cwd } ) ;
110- }
111- } ) . pipe (
112- Effect . provide (
113- layerTest ( {
114- platform : "darwin" ,
115- env : { PATH : bin } ,
116- onSpawn : ( command ) => spawned . push ( command ) ,
117- } ) ,
118- ) ,
119- Effect . provideService ( HostProcess . HomeDirectory , "/Users/server" ) ,
120- ) ;
121- assert . deepEqual (
122- spawned . map ( ( command ) => command . args ) ,
123- [ [ "/Users/server/Applications/My App.app" ] , [ "/Applications/My App.app" ] ] ,
124- ) ;
125- } ) . pipe ( Effect . provide ( NodeServices . layer ) ) ,
98+ // macOS command lookup cannot search a Windows drive-letter PATH.
99+ it . effect . skipIf ( windowsHost ) (
100+ "opens home-relative app bundles using the server home directory" ,
101+ ( ) =>
102+ Effect . gen ( function * ( ) {
103+ const fs = yield * FileSystem . FileSystem ;
104+ const path = yield * Path . Path ;
105+ const bin = yield * fs . makeTempDirectoryScoped ( { prefix : "t3-app-open-" } ) ;
106+ yield * fs . writeFileString ( path . join ( bin , "open" ) , "#!/bin/sh\n" ) ;
107+ yield * fs . chmod ( path . join ( bin , "open" ) , 0o755 ) ;
108+ const spawned : ChildProcess . StandardCommand [ ] = [ ] ;
109+ yield * Effect . gen ( function * ( ) {
110+ const launcher = yield * ExternalLauncher . ExternalLauncher ;
111+ for ( const cwd of [ "~/Applications/My App.app" , "/Applications/My App.app" ] ) {
112+ yield * launcher . launchEditor ( { editor : "file-manager" , cwd } ) ;
113+ }
114+ } ) . pipe (
115+ Effect . provide (
116+ layerTest ( {
117+ platform : "darwin" ,
118+ env : { PATH : bin } ,
119+ onSpawn : ( command ) => spawned . push ( command ) ,
120+ } ) ,
121+ ) ,
122+ Effect . provideService ( HostProcess . HomeDirectory , "/Users/server" ) ,
123+ ) ;
124+ assert . deepEqual (
125+ spawned . map ( ( command ) => command . args ) ,
126+ [ [ "/Users/server/Applications/My App.app" ] , [ "/Applications/My App.app" ] ] ,
127+ ) ;
128+ } ) . pipe ( Effect . provide ( NodeServices . layer ) ) ,
126129) ;
127130
128131it . effect . skipIf ( windowsHost ) (
0 commit comments