1
0
mirror of https://github.com/desktop/desktop synced 2024-07-05 00:58:57 +00:00

add some notes

This commit is contained in:
Brendan Forster 2018-08-03 15:08:17 -03:00
parent 2381d5fe22
commit 49b1f14b45

View File

@ -13,16 +13,18 @@ const options: SpawnSyncOptions = {
}
function findYarnVersion(callback: (path: string) => void) {
glob('vendor/yarn-*.js', options, (error, files) => {
glob('vendor/yarn-*.js', (error, files) => {
if (error != null) {
throw error
}
// this ensures the paths returned by glob are sorted alphabetically
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)
})
}