added review comments

This commit is contained in:
Akshaya M
2020-03-16 17:07:31 +05:30
parent 7fc98cfa3d
commit c909df3338
6 changed files with 16 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
export class Constants {
export default class Constants {
static readonly prefix: string = "az_";
static readonly moduleName: string = "Az.Accounts";
static readonly versionPattern = /[0-9]\.[0-9]\.[0-9]/;

View File

@@ -3,7 +3,7 @@ import * as core from '@actions/core';
import Utils from './Utilities/Utils';
import PowerShellToolRunner from './Utilities/PowerShellToolRunner';
import ScriptBuilder from './Utilities/ScriptBuilder';
import { Constants } from './Constants';
import Constants from './Constants';
export class ServicePrincipalLogin implements IAzurePowerShellSession {
static readonly environment: string = Constants.environment;
@@ -29,7 +29,7 @@ export class ServicePrincipalLogin implements IAzurePowerShellSession {
}
async login() {
PowerShellToolRunner.init();
await PowerShellToolRunner.init();
const scriptBuilder: ScriptBuilder = new ScriptBuilder();
const script: string = scriptBuilder.getScript(ServicePrincipalLogin.scheme, this.tenantId, this.servicePrincipalId, this.servicePrincipalKey,
this.subscriptionId, ServicePrincipalLogin.environment, ServicePrincipalLogin.scopeLevel);

View File

@@ -2,7 +2,7 @@ import * as os from 'os';
import * as exec from '@actions/exec';
import * as io from '@actions/io';
import { Constants } from '../Constants';
import Constants from '../Constants';
import PowerShellToolRunner from './PowerShellToolRunner';
export default class Utils {
@@ -19,7 +19,7 @@ export default class Utils {
}
}
};
PowerShellToolRunner.init();
await PowerShellToolRunner.init();
await PowerShellToolRunner.executePowerShellCommand(`(Get-Module -Name ${moduleName} -ListAvailable | Sort-Object Version -Descending | Select-Object -First 1).Version.ToString()`, options);
if(!Utils.isValidVersion(output.trim())) {
return "";