BREAKING CHANGE(switch to esm): update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as plugins from './sdk.plugins';
|
||||
import { AuthInfo } from './sdk.classes.authinfo';
|
||||
import { AgEnvironment } from './sdk.classes.agenvironment';
|
||||
import * as plugins from './sdk.plugins.js';
|
||||
import { AuthInfo } from './sdk.classes.authinfo.js';
|
||||
import { AgEnvironment } from './sdk.classes.agenvironment.js';
|
||||
|
||||
export interface IRequirementResult {
|
||||
allOk: boolean;
|
||||
@@ -18,8 +18,10 @@ export abstract class AAgHandler<TClaim> {
|
||||
public abstract checkRequirements(): Promise<IRequirementResult>;
|
||||
|
||||
public async checkQenvFile(pathToQenvFileArg: string) {
|
||||
if(!(await plugins.smartfile.fs.fileExists(pathToQenvFileArg))) {
|
||||
throw new Error(`AgHandler with slug '${this.slug}': qenv file does not exists at ${pathToQenvFileArg}`);
|
||||
if (!(await plugins.smartfile.fs.fileExists(pathToQenvFileArg))) {
|
||||
throw new Error(
|
||||
`AgHandler with slug '${this.slug}': qenv file does not exists at ${pathToQenvFileArg}`
|
||||
);
|
||||
}
|
||||
const qenvFile = plugins.smartfile.fs.toObjectSync(pathToQenvFileArg);
|
||||
const missingEnvironmentVariables: string[] = [];
|
||||
@@ -30,7 +32,9 @@ export abstract class AAgHandler<TClaim> {
|
||||
}
|
||||
}
|
||||
if (missingEnvironmentVariables.length > 0) {
|
||||
console.log(`AgHandler with slug '${this.slug}': There are ${missingEnvironmentVariables.length} missing environment variables`);
|
||||
console.log(
|
||||
`AgHandler with slug '${this.slug}': There are ${missingEnvironmentVariables.length} missing environment variables`
|
||||
);
|
||||
const errorMessage = `AgHandler with slug '${this.slug}': The missing env Varibles are ${missingEnvironmentVariables}`;
|
||||
console.log(errorMessage);
|
||||
throw new Error(errorMessage);
|
||||
|
||||
Reference in New Issue
Block a user