@@ -64,22 +64,33 @@ export class WireitTestRig
6464 */
6565 override async setup ( ) {
6666 await super . setup ( ) ;
67- const absWireitBinaryPath = pathlib . resolve ( repoRoot , 'bin' , 'wireit.js' ) ;
68- const absWireitTempInstallPath = pathlib . resolve (
69- this . temp ,
70- 'node_modules' ,
71- '.bin' ,
72- 'wireit' ,
67+
68+ Promise . all (
69+ [
70+ [ 'wireit' , [ 'bin' , 'wireit.js' ] ] as const ,
71+ [ 'yarnBerry' , [ '.yarn' , 'releases' , 'yarn-4.0.1.cjs' ] ] as const ,
72+ ] . map (
73+ async ( [ name , pathParts ] ) => {
74+ const binaryPath = pathlib . resolve ( repoRoot , ...pathParts ) ;
75+ const tempInstallPath = pathlib . resolve (
76+ this . temp ,
77+ 'node_modules' ,
78+ '.bin' ,
79+ name ,
80+ ) ;
81+
82+ if ( IS_WINDOWS ) {
83+ // Npm install works differently on Windows, since it won't recognize a
84+ // shebang like "#!/usr/bin/env node". Npm instead uses the cmd-shim
85+ // package to generate Windows shell wrappers for each binary, so we do
86+ // that here too.
87+ await cmdShim ( binaryPath , tempInstallPath ) ;
88+ } else {
89+ await this . symlink ( binaryPath , tempInstallPath , 'file' ) ;
90+ }
91+ }
92+ )
7393 ) ;
74- if ( IS_WINDOWS ) {
75- // Npm install works differently on Windows, since it won't recognize a
76- // shebang like "#!/usr/bin/env node". Npm instead uses the cmd-shim
77- // package to generate Windows shell wrappers for each binary, so we do
78- // that here too.
79- await cmdShim ( absWireitBinaryPath , absWireitTempInstallPath ) ;
80- } else {
81- await this . symlink ( absWireitBinaryPath , absWireitTempInstallPath , 'file' ) ;
82- }
8394 }
8495
8596 /**
0 commit comments