mirror of
https://github.com/desktop/desktop
synced 2024-10-03 23:03:52 +00:00
add some notes
This commit is contained in:
parent
2381d5fe22
commit
49b1f14b45
|
@ -13,16 +13,18 @@ const options: SpawnSyncOptions = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function findYarnVersion(callback: (path: string) => void) {
|
function findYarnVersion(callback: (path: string) => void) {
|
||||||
glob('vendor/yarn-*.js', options, (error, files) => {
|
glob('vendor/yarn-*.js', (error, files) => {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this ensures the paths returned by glob are sorted alphabetically
|
||||||
files.sort()
|
files.sort()
|
||||||
|
|
||||||
const foundVersion = files[files.length - 1]
|
// use the latest version here if multiple are found
|
||||||
|
const latestVersion = files[files.length - 1]
|
||||||
|
|
||||||
callback(foundVersion)
|
callback(latestVersion)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue