@@ -898,15 +898,21 @@ describe("archive runner script", () => {
898898 yield * fs . makeDirectory ( home , { recursive : true } ) ;
899899 // uutils coreutils (Ubuntu's default) mkdir exits 0 when it loses the
900900 // race to create a directory. Shim that behavior so the race covers
901- // such hosts wherever the test runs.
902- const hostPath = process . env . PATH ?? "" ;
903- yield * fs . makeDirectory ( `${ root } /bin` ) ;
901+ // such hosts wherever the test runs, and count unpacks to prove a
902+ // single install. Each shim drops its own directory from PATH.
903+ const bin = `${ root } /bin` ;
904+ yield * fs . makeDirectory ( bin ) ;
904905 yield * fs . writeFileString (
905- `${ root } / bin/mkdir` ,
906- ` #!/bin/sh\nPATH=' ${ hostPath } ' exec mkdir -p "$@"\n` ,
906+ `${ bin } /mkdir` ,
907+ ' #!/bin/sh\nPATH=${PATH#*:}\nexec mkdir -p "$@"\n' ,
907908 ) ;
908- yield * fs . chmod ( `${ root } /bin/mkdir` , 0o755 ) ;
909- const racePath = `${ root } /bin:${ hostPath } ` ;
909+ yield * fs . writeFileString (
910+ `${ bin } /tar` ,
911+ '#!/bin/sh\necho >> "${0%/*}/installs"\nPATH=${PATH#*:}\nexec tar "$@"\n' ,
912+ ) ;
913+ yield * fs . chmod ( `${ bin } /mkdir` , 0o755 ) ;
914+ yield * fs . chmod ( `${ bin } /tar` , 0o755 ) ;
915+ const racePath = `${ bin } :${ process . env . PATH ?? "" } ` ;
910916
911917 const results = yield * Effect . all (
912918 [
@@ -920,6 +926,7 @@ describe("archive runner script", () => {
920926 assert . equal ( result . exitCode , 0 , result . stderr ) ;
921927 assert . include ( result . stdout , `t3 v${ archiveVersion } ` ) ;
922928 }
929+ assert . equal ( yield * fs . readFileString ( `${ bin } /installs` ) , "\n" ) ;
923930 const versionsDir = `${ home } /.t3/runtime/versions` ;
924931 assert . deepEqual ( yield * fs . readDirectory ( versionsDir ) , [ archiveVersion ] ) ;
925932 assert . equal (
0 commit comments