From 24212d6a5ec16b708f5923d26c03c00b542dc347 Mon Sep 17 00:00:00 2001 From: Sanjaiyan Parthipan Date: Thu, 13 Jun 2024 02:34:58 +0530 Subject: [PATCH] perf: Improve the performance by running ion concurrent --- sources/commands/InstallGlobal.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/commands/InstallGlobal.ts b/sources/commands/InstallGlobal.ts index 6161c4603..6b47834ad 100644 --- a/sources/commands/InstallGlobal.ts +++ b/sources/commands/InstallGlobal.ts @@ -43,13 +43,13 @@ export class InstallGlobalCommand extends BaseCommand { if (this.args.length === 0) throw new UsageError(`No package managers specified`); - for (const arg of this.args) { + await Promise.all(this.args.map((arg) => { if (arg.endsWith(`.tgz`)) { - await this.installFromTarball(path.resolve(this.context.cwd, arg)); + return this.installFromTarball(path.resolve(this.context.cwd, arg)); } else { - await this.installFromDescriptor(specUtils.parseSpec(arg, `CLI arguments`, {enforceExactVersion: false})); + return this.installFromDescriptor(specUtils.parseSpec(arg, `CLI arguments`, { enforceExactVersion: false })); } - } + })) } log(locator: Locator) {