Skip to content

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvNC committed Dec 23, 2023
1 parent 4d17912 commit 3b251ed
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/convertWikipedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import { Dictionary, TermEntry } from 'yomichan-dict-builder';
import { parseLine } from './parseLine.js';
import { languagesAllowed } from './constants.js';

import { version } from '../package.json';

const linkCharacter = '⧉';
const outputZipName = (lang) => `${lang} Wikipedia (v${version}).zip`;
const outputZipName = (lang, version) => `${lang} Wikipedia (v${version}).zip`;
const shortAbstractFile = (lang) =>
`short-abstracts_lang=${lang.toLowerCase()}.ttl`;

(async () => {
const version = await getVersion();

console.log(`Using version ${version}`);

const { lang, date } = readArgs();
console.log(`Converting ${lang} Wikipedia dump from ${date}...`);

Expand Down Expand Up @@ -179,3 +181,9 @@ function readArgs() {
}
return { lang, date: dateInput };
}

function getVersion() {
const packageJsonPath = path.join(process.cwd(), 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
return packageJson.version;
}

0 comments on commit 3b251ed

Please sign in to comment.