Change some test variables using 'source' instead of 'content'
This commit is contained in:
parent
ba68616d80
commit
99c1a6a6bc
@ -39,15 +39,15 @@ function createTestDictionaryArchive(dictionary, dictionaryName) {
|
|||||||
|
|
||||||
for (const fileName of fileNames) {
|
for (const fileName of fileNames) {
|
||||||
if (/\.json$/.test(fileName)) {
|
if (/\.json$/.test(fileName)) {
|
||||||
const source = fs.readFileSync(path.join(dictionaryDirectory, fileName), {encoding: 'utf8'});
|
const content = fs.readFileSync(path.join(dictionaryDirectory, fileName), {encoding: 'utf8'});
|
||||||
const json = JSON.parse(source);
|
const json = JSON.parse(content);
|
||||||
if (fileName === 'index.json' && typeof dictionaryName === 'string') {
|
if (fileName === 'index.json' && typeof dictionaryName === 'string') {
|
||||||
json.title = dictionaryName;
|
json.title = dictionaryName;
|
||||||
}
|
}
|
||||||
archive.file(fileName, JSON.stringify(json, null, 0));
|
archive.file(fileName, JSON.stringify(json, null, 0));
|
||||||
} else {
|
} else {
|
||||||
const source = fs.readFileSync(path.join(dictionaryDirectory, fileName), {encoding: null});
|
const content = fs.readFileSync(path.join(dictionaryDirectory, fileName), {encoding: null});
|
||||||
archive.file(fileName, source);
|
archive.file(fileName, content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user