fix(core): update

This commit is contained in:
2024-01-25 13:57:55 +01:00
parent 45deb1a8d2
commit caca370e77
5 changed files with 290 additions and 110 deletions

View File

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

View File

@@ -3,9 +3,15 @@ import * as paths from './npmextra.paths.js';
import { KeyValueStore } from './npmextra.classes.keyvaluestore.js';
export class AppData {
/**
* creates appdata. If no pathArg is given, data will be stored here:
* ${PWD}/.nogit/appdata
* @param pathArg
* @returns
*/
public static async createAndInit(pathArg?: string) {
const appData = new AppData(pathArg);
await appData.init();
await appData.readyDeferred.promise;
return appData;
}
@@ -14,12 +20,17 @@ export class AppData {
public dirPathArg: string;
private kvStore: KeyValueStore;
constructor(pathArg?: string) {
this.init(pathArg);
this.dirPathArg = pathArg;
this.init;
}
/**
* inits app data
* @param pathArg
*/
private async init(pathArg?: string) {
if (pathArg) {
this.dirPathArg = pathArg;
if (this.dirPathArg) {
// ok, nothing to do here;
} else {
const appDataDir = '/app/data';
const dataDir = '/data';