diff --git a/src/commands/init.ts b/src/commands/init.ts index 630abb4..1dd0dfe 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -48,7 +48,7 @@ module.exports = async function(options?: HexaInitOptions) { const subscriptions: AzureSubscription[] = Config.get("subscriptions"); if (!subscriptions || (subscriptions && subscriptions.length === 0) || process.env.HEXA_FORCE_LOGIN) { - await require(`./login`)(); + await (require(`./login`))(); } else { debug(`found subscriptions ${chalk.green(JSON.stringify(subscriptions))}`); } diff --git a/src/features/container-registry/index.ts b/src/features/container-registry/index.ts index e04c79c..5be132f 100644 --- a/src/features/container-registry/index.ts +++ b/src/features/container-registry/index.ts @@ -27,7 +27,7 @@ module.exports = async function() { if (acrList.length === 0) { // no ACR accout found, create one - return await require(`./create`)("AUTOMATIC"); + return await (require(`./create`))("AUTOMATIC"); } if (creationMode === "AUTOMATIC") { @@ -43,7 +43,7 @@ module.exports = async function() { selectedAcrId = acr.id; } else { // we founf one cluster but it was not created by Hexa, go ahead and automatically create one - return (await require(`./create`))("AUTOMATIC"); + return await (require(`./create`))("AUTOMATIC"); } } else if (Array.isArray(acrList)) { // we found many ACR accounts, let the user choose the right one @@ -55,7 +55,7 @@ module.exports = async function() { if (selectedAcrId === "MANUAL") { // the user expliticitly chooses to manually create a ACR account - return (await require(`./create`))("MANUAL"); + return await (require(`./create`))("MANUAL"); } const { id, name, hostname } = acrList.find((acr: AzureContainerRegistry) => acr.id === selectedAcrId) as AzureContainerRegistry; diff --git a/src/features/functions/index.ts b/src/features/functions/index.ts index 1f6a8f3..97d420e 100644 --- a/src/features/functions/index.ts +++ b/src/features/functions/index.ts @@ -52,5 +52,5 @@ module.exports = async function() { }); // init functions projects - return (await require("./init"))(); + return await (require("./init"))(); }; diff --git a/src/features/resource-group/index.ts b/src/features/resource-group/index.ts index 622c880..4117c7d 100644 --- a/src/features/resource-group/index.ts +++ b/src/features/resource-group/index.ts @@ -3,7 +3,7 @@ import { az, Config, saveWorkspace } from "../../core/utils"; module.exports = async function() { if (process.env.HEXA_AUTO_MODE) { - return (await require(`./create`))("AUTOMATIC"); + return await (require(`./create`))("AUTOMATIC"); } // https://docs.microsoft.com/en-us/cli/azure/group?view=azure-cli-latest#az-group-list @@ -17,7 +17,7 @@ module.exports = async function() { if (selectedResourceId === "MANUAL") { // create a new resource group - return (await require(`./create`))(selectedResourceId); + return await (require(`./create`))(selectedResourceId); } else { const { id, name, location } = resourceGroupsList.find( (resourceGroup: AzureResourceGroup) => resourceGroup.id === (selectedResourceId as string) @@ -36,6 +36,6 @@ module.exports = async function() { } else { // no resource found // create a new resource group - return (await require(`./create`))("AUTOMATIC"); + return await (require(`./create`))("AUTOMATIC"); } }; diff --git a/src/features/storage/create.ts b/src/features/storage/create.ts index f908827..31c231b 100644 --- a/src/features/storage/create.ts +++ b/src/features/storage/create.ts @@ -34,5 +34,5 @@ module.exports = async function(creationMode: CreationMode) { storage }); - return (await require("./tokens"))(); + return await (require("./tokens"))(); }; diff --git a/src/index.ts b/src/index.ts index eb4f0b3..7a2b88f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,7 +27,7 @@ let debug: Function; .filter(feat => feat); } - return (await require(`./commands/${commandName}`))(options); + return await (require(`./commands/${commandName}`))(options); } catch (error) { console.error(chalk.red(`Command "${commandName}" not supported yet.`)); console.error(chalk.red(error));