Skip to content

Commit

Permalink
Use for await in install function (#1474)
Browse files Browse the repository at this point in the history
  • Loading branch information
origami-z authored Nov 3, 2024
1 parent b7c3106 commit f090a05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const install = async (
const isWorkspace = options.workspaces || !!options.workspace?.length
const pkgsNormalized = isWorkspace ? ['package.json'] : pkgs

pkgsNormalized.forEach(async pkgFile => {
for await (const pkgFile of pkgsNormalized) {
const packageManager = await getPackageManagerForInstall(options, pkgFile)
const cmd = packageManager + (process.platform === 'win32' ? '.cmd' : '')
const cwd = options.cwd || path.resolve(pkgFile, '..')
Expand Down Expand Up @@ -183,7 +183,7 @@ const install = async (
// if there is nothing on stderr, reject with stdout
throw new Error(err?.message || err || stdout)
}
})
}
}
// show the install hint unless auto-install occurred
else if (!isInteractive) {
Expand Down

0 comments on commit f090a05

Please sign in to comment.