diff --git a/changelog.md b/changelog.md index 8349978..0d53ff1 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2024-09-19 - 5.3.0 - feat(TapNodeTools) +Add getEnvVarOnDemand method to TapNodeTools + +- Introduced a new method getEnvVarOnDemand to the TapNodeTools class to fetch environment variables on demand. +- Enhanced getQenv function in TapNodeTools class to cache the Qenv instance for better performance. + ## 2024-09-19 - 5.2.2 - fix(core) Ensure reliability in test setup and execution diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index c41bdb0..e5d618d 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/tapbundle', - version: '5.2.2', + version: '5.3.0', description: 'A test automation library bundling utilities and tools for TAP (Test Anything Protocol) based testing, specifically tailored for tapbuffer.' } diff --git a/ts_node/classes.tapnodetools.ts b/ts_node/classes.tapnodetools.ts index dc8948a..84b6e41 100644 --- a/ts_node/classes.tapnodetools.ts +++ b/ts_node/classes.tapnodetools.ts @@ -5,8 +5,14 @@ class TapNodeTools { constructor() {} + private qenv: plugins.qenv.Qenv; public async getQenv(): Promise { - return new plugins.qenv.Qenv('./', '.nogit/'); + this.qenv = this.qenv || new plugins.qenv.Qenv('./', '.nogit/'); + return this.qenv; + } + public async getEnvVarOnDemand(envVarNameArg: string): Promise { + const qenv = await this.getQenv(); + return qenv.getEnvVarOnDemand(envVarNameArg); } public async runCommand(commandArg: string): Promise {