Compare commits

...

4 Commits

Author SHA1 Message Date
bb9de1b13b 4.0.16 2024-02-12 18:40:01 +01:00
080e133e9f fix(core): update 2024-02-12 18:40:01 +01:00
a284c58a68 4.0.15 2024-02-10 04:55:51 +01:00
18bb54831d fix(core): update 2024-02-10 04:55:50 +01:00
3 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@push.rocks/npmextra",
"version": "4.0.14",
"version": "4.0.16",
"private": false,
"description": "do more with npm",
"main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/npmextra',
version: '4.0.14',
version: '4.0.16',
description: 'do more with npm'
}

View File

@ -1,6 +1,7 @@
import * as plugins from './npmextra.plugins.js';
import * as paths from './npmextra.paths.js';
import { KeyValueStore } from './npmextra.classes.keyvaluestore.js';
import { env } from 'process';
export interface IAppDataOptions {
dirPath?: string;
@ -68,8 +69,11 @@ export class AppData {
if (this.options.envMapping) {
const qenvInstance = new plugins.qenv.Qenv(process.cwd(), '~/.cloudlyrc');
for (const key in this.options.envMapping) {
const envValue = await qenvInstance.getEnvVarOnDemand(key);
let envValue = await qenvInstance.getEnvVarOnDemand(key);
if (envValue) {
if (key.endsWith('_JSON')) {
envValue = JSON.parse(envValue);
}
await this.kvStore.writeKey(key, envValue);
}
}
@ -100,8 +104,9 @@ export class AppData {
}
}
public async waitForKeysPresent(keysArg: string[]) {
public async waitForAndGetKey(keyArg: string) {
await this.readyDeferred.promise;
await this.kvStore.waitForKeysPresent(keysArg);
await this.kvStore.waitForKeysPresent([keyArg]);
return this.kvStore.readKey[keyArg];
}
}