Skip to content

Commit

Permalink
Update DB version in update_db subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
akawashiro committed Feb 6, 2024
1 parent 8949e17 commit 626dfd0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jendeley-backend/src/update_db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import fetch from "node-fetch";
import { Request as NFRequest } from "node-fetch";
import { Either, genLeft, genRight } from "./either";
import { validateJsonDB } from "./validate_db";
import { ENTRY_AUTHORS, ENTRY_TEXT, ENTRY_TITLE } from "./constants";
import {
ENTRY_AUTHORS,
ENTRY_TEXT,
DB_META_KEY,
JENDELEY_VERSION,
} from "./constants";

async function getTextsFromPDF(
pdfFullpath: string,
Expand Down Expand Up @@ -79,6 +84,7 @@ async function update_db(dbPathVer1: string[], dbPathVer2: string[]) {
jsonDB[id][ENTRY_AUTHORS] = [];
}
}
jsonDB[DB_META_KEY]["version"] = JENDELEY_VERSION;

if (fs.existsSync(concatDirs(dbPathVer2))) {
logger.fatal(dbPathVer2 + " already exists.");
Expand Down

0 comments on commit 626dfd0

Please sign in to comment.