diff --git a/package-lock.json b/package-lock.json index 5c9a98401..8e4c300d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -167,9 +167,9 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" }, "asynckit": { "version": "0.4.0", diff --git a/package.json b/package.json index fa0f868d8..ea442a84f 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "dependencies": { "@atom/plist": "0.4.4", "asar-require": "0.3.0", - "async": "~0.9.2", + "async": "^3.2.0", "colors": "~1.4.0", "first-mate": "^7.4.1", "fs-plus": "3.x", diff --git a/src/install.coffee b/src/install.coffee index bc4fac45b..383d9f72c 100644 --- a/src/install.coffee +++ b/src/install.coffee @@ -518,16 +518,17 @@ class Install extends Command ] cloneFirstValidGitUrl: (urls, cloneDir, options, callback) -> - async.detectSeries urls, (url, next) => + async.detectSeries(urls, (url, next) => @cloneNormalizedUrl url, cloneDir, options, (error) -> - next(not error) - , (result) -> - if not result + next(null, not error) + , (err, result) -> + if err or not result invalidUrls = "Couldn't clone #{urls.join(' or ')}" invalidUrlsError = new Error(invalidUrls) callback(invalidUrlsError) else callback() + ) cloneNormalizedUrl: (url, cloneDir, options, callback) -> # Require here to avoid circular dependency