MCPcopy
hub / github.com/desktop/desktop / findYarnVersion

Function findYarnVersion

script/post-install.ts:30–42  ·  view source on GitHub ↗
(callback: (path: string) => void)

Source from the content-addressed store, hash-verified

28)
29
30function findYarnVersion(callback: (path: string) => void) {
31 glob('vendor/yarn-*.js', (error, files) => {
32 if (error != null) {
33 throw error
34 }
35
36 // this ensures the paths returned by glob are sorted alphabetically
37 files.sort()
38
39 // use the latest version here if multiple are found
40 callback(forceUnwrap('Missing vendored yarn', files.at(-1)))
41 })
42}
43
44findYarnVersion(path => {
45 let result = spawnSync(

Callers 1

post-install.tsFile · 0.85

Calls 1

forceUnwrapFunction · 0.90

Tested by

no test coverage detected