Skip to content

Commit

Permalink
lnote-1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhwagk committed Feb 24, 2024
1 parent b29be5e commit b16c223
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "lnote",
"displayName": "lnote",
"description": "A simple note-taking extension.",
"version": "1.1.1",
"version": "1.1.3",
"icon": "icon.png",
"publisher": "shinhwagk",
"preview": true,
Expand Down Expand Up @@ -246,6 +246,7 @@
},
"dependencies": {
"@types/flexsearch": "^0.7.3",
"@vscode/vsce": "^2.24.0",
"flexsearch": "^0.7.31",
"fs-extra": "^11.1.1",
"object-path": "^0.11.8",
Expand Down
13 changes: 9 additions & 4 deletions src/database/domain.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as path from 'path';

import { copyFileSync, existsSync, mkdirpSync } from 'fs-extra';
import objectPath from 'object-path';
import * as path from 'path';

import { arrayLabels2GroupLabels, groupLabels2ArrayLabels, tools, vfs } from '../helper';
import { ArrayLabels, GroupLables } from '../types';
Expand All @@ -21,12 +22,16 @@ export class LDomain {
readonly nb: string,
readonly dir: string
) {
this.domainFile = path.join(this.dir, 'domains.json');
existsSync(this.domainFile) || this.create([this.nb]);

this.historyDir = path.join(this.dir, 'history');
existsSync(this.historyDir) || mkdirpSync(this.historyDir);

this.domainFile = path.join(this.dir, 'domains.json');
if (!existsSync(this.domainFile)) {
// init empty file
vfs.writeJsonSync(this.domainFile, this.domainCache)
this.create([nb])
}

this.domainCache = vfs.readJsonSync<NBDomainStruct>(this.domainFile);
}

Expand Down

0 comments on commit b16c223

Please sign in to comment.