Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/mdProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ function cleanupTempDirs(dir, logger) {
logger.warning("Expected folder does not exist: " + dir);
return;
}
let stat;
try {
let stat = fse.statSync(dir);
stat = fse.statSync(dir);
if (!stat.isDirectory()) {
logger.warning("Expected folder is a file: " + dir);
return;
Expand Down Expand Up @@ -415,8 +416,9 @@ function generateHTML(
version
) {
const tempDirPath = path.join(destination, FILENAME_TEMP);
let stat;
try {
let stat = fse.statSync(tempDirPath);
stat = fse.statSync(tempDirPath);
if (!stat.isDirectory()) {
try {
fse.removeSync(tempDirPath); /* file */
Expand Down Expand Up @@ -714,7 +716,7 @@ function writeTempTOCfile(tempDirPath, filename, extension, content, logger) {
const tempTOCpath = path.join(tempDirPath, tempTOCfilename);
try {
const writeTempTOCFd = fse.openSync(tempTOCpath, "w");
let success = common.writeFile(writeTempTOCFd, Buffer.from(content));
const success = common.writeFile(writeTempTOCFd, Buffer.from(content));
fse.closeSync(writeTempTOCFd);
if (!success) {
logger.error("*** Failed to write file: " + tempTOCpath);
Expand Down Expand Up @@ -896,7 +898,6 @@ function generateTOCs(
logger);
}
} catch (e) {
console.log(e);
logger.warning("Excluded from toc generation because no corresponding destination folder found: " + sourcePath);
}
}
Expand Down Expand Up @@ -978,7 +979,7 @@ function generateTOCs(
}

if (tocJSON) {
let adapter = new markedIt.tocJSONadapter();
const adapter = new markedIt.tocJSONadapter();
tocFilename = path.join(destination, FILENAME_TOC_JSON);
if (tocFileLines) {
tocContent = generateTOC(
Expand Down Expand Up @@ -1060,7 +1061,6 @@ function writeTocFile(
}
} catch (e) {
logger.error("Failed to open file to write: " + tocFilename + "\n" + e.toString());
console.log(e);
}
} else {
logger.warning("Skipped writing toc file due to a file collision: " + tocFilename);
Expand Down Expand Up @@ -1352,13 +1352,13 @@ function addYamlTopics(
}

if (tocItem) {
// last item of the topics tree
// last item of the topics tree
if (isLast && i === topics.length - 1) {
computedAttributes = {
class: 'navgroup-end'
};
} else {
// navgroup with only an array of references
// navgroup with only an array of references
if (level === 2 && i === 0) {
computedAttributes = {
class: 'navgroup',
Expand Down