Skip to content

Commit

Permalink
🐛 Fix support for upcoming Atom versions
Browse files Browse the repository at this point in the history
Fixes #57
  • Loading branch information
Steel Brain committed Aug 26, 2016
1 parent 06fe553 commit a666a95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 4.3.0

* Fix support for upcoming Atom versions
* Use babel style exports (backward compatible)

## 4.2.0
Expand Down
9 changes: 7 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ if (typeof window.__steelbrain_package_deps === 'undefined') {
window.__steelbrain_package_deps = new Set()
}

async function install(givenPackageName: ?string) {
const packageName = givenPackageName || AtomPackagePath.guessFromCallIndex(5)
async function installDependencies(packageName: ?string): Promise<void> {
invariant(packageName, '[Package-Deps] Failed to determine package name')

const dependencies = Helpers.getDependencies(packageName)
Expand All @@ -35,5 +34,11 @@ async function install(givenPackageName: ?string) {
await Promise.all(promises)
}

function install(givenPackageName: ?string) {
// NOTE: We are wrapping the async function in a sync function to avoid extra
// stack values before we extract names
return installDependencies(givenPackageName || AtomPackagePath.guessFromCallIndex(2))
}

export default install
export { install }

0 comments on commit a666a95

Please sign in to comment.