@@ -284,7 +284,7 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
284284 true ,
285285 ) ;
286286 expect ( yield * fs . readFileString ( plan . unitPath ) ) . toContain (
287- ` <key>PATH</key>\n <string>${ macInstallerPath } </string>` ,
287+ ` <key>PATH</key>\n <string>${ macInstallerPath } :/usr/local/bin:/usr/sbin:/sbin </string>` ,
288288 ) ;
289289 expect ( parseServiceState ( yield * fs . readFileString ( statePath ) ) ) . toEqual ( {
290290 protocol : SERVICE_LAUNCHER_PROTOCOL ,
@@ -335,6 +335,18 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
335335 } ) ,
336336 ) ;
337337
338+ it . effect ( "adds missing provider directories to a minimal installer PATH" , ( ) =>
339+ Effect . gen ( function * ( ) {
340+ const { service, fs } = yield * makeHarness ( "darwin" , false , "/usr/bin:/bin" ) ;
341+ const plan = yield * service . install ;
342+
343+ expect ( yield * fs . readFileString ( plan . unitPath ) ) . toContain (
344+ " <key>PATH</key>\n <string>/usr/bin:/bin:/opt/homebrew/bin:/usr/local/bin:/usr/sbin:/sbin</string>" ,
345+ ) ;
346+ expect ( ( yield * service . status ) . current ) . toBe ( true ) ;
347+ } ) ,
348+ ) ;
349+
338350 it . effect ( "keeps an installed launch agent current when the process PATH changes" , ( ) =>
339351 Effect . gen ( function * ( ) {
340352 const { service, makeService } = yield * makeHarness ( "darwin" ) ;
@@ -356,7 +368,7 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
356368 const plist = yield * fs . readFileString ( plan . unitPath ) ;
357369
358370 expect ( plist ) . toContain (
359- " <key>PATH</key>\n <string>/opt/homebrew/bin:/usr/bin</string>" ,
371+ " <key>PATH</key>\n <string>/opt/homebrew/bin:/usr/bin:/usr/local/bin:/bin:/usr/sbin:/sbin </string>" ,
360372 ) ;
361373 expect ( plist ) . not . toContain ( "\u0001" ) ;
362374 expect ( ( yield * service . status ) . current ) . toBe ( true ) ;
0 commit comments