ESlinted scripts
This commit is contained in:
@ -45,10 +45,10 @@ if (
|
|||||||
.readdirSync(SNIPPETS_ARCHIVE_PATH)
|
.readdirSync(SNIPPETS_ARCHIVE_PATH)
|
||||||
.sort((a, b) => a.toLowerCase() - b.toLowerCase());
|
.sort((a, b) => a.toLowerCase() - b.toLowerCase());
|
||||||
// Store the data read from each snippet in the appropriate object
|
// Store the data read from each snippet in the appropriate object
|
||||||
for (const name of snippetFilenames.filter(s => s !== 'README.md')) {
|
for (const name of snippetFilenames.filter(s => s !== 'README.md'))
|
||||||
snippets[name] = fs.readFileSync(path.join(SNIPPETS_ARCHIVE_PATH, name), 'utf8');
|
snippets[name] = fs.readFileSync(path.join(SNIPPETS_ARCHIVE_PATH, name), 'utf8');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@ -65,13 +65,13 @@ if (
|
|||||||
);
|
);
|
||||||
output += misc.hr();
|
output += misc.hr();
|
||||||
|
|
||||||
for (const snippet of Object.entries(snippets)) {
|
for (const snippet of Object.entries(snippets))
|
||||||
output += makeExamples(snippet[1]);
|
output += makeExamples(snippet[1]);
|
||||||
}
|
|
||||||
|
|
||||||
// Write to the README file of the archive
|
// Write to the README file of the archive
|
||||||
fs.writeFileSync(path.join(SNIPPETS_ARCHIVE_PATH, 'README.md'), output);
|
fs.writeFileSync(path.join(SNIPPETS_ARCHIVE_PATH, 'README.md'), output);
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During README generation for snippets archive: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During README generation for snippets archive: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@ -110,7 +110,8 @@ snippets = util.readSnippets(SNIPPETS_PATH);
|
|||||||
try {
|
try {
|
||||||
startPart = fs.readFileSync(path.join(STATIC_PARTS_PATH, 'README-start.md'), 'utf8');
|
startPart = fs.readFileSync(path.join(STATIC_PARTS_PATH, 'README-start.md'), 'utf8');
|
||||||
endPart = fs.readFileSync(path.join(STATIC_PARTS_PATH, 'README-end.md'), 'utf8');
|
endPart = fs.readFileSync(path.join(STATIC_PARTS_PATH, 'README-end.md'), 'utf8');
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@ -170,7 +171,8 @@ try {
|
|||||||
output += `\n${endPart}\n`;
|
output += `\n${endPart}\n`;
|
||||||
// Write to the README file
|
// Write to the README file
|
||||||
fs.writeFileSync('README.md', output);
|
fs.writeFileSync('README.md', output);
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During README generation: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During README generation: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,9 +28,9 @@ try {
|
|||||||
// turn it into an object so we can add data to it to be used in a different scope
|
// turn it into an object so we can add data to it to be used in a different scope
|
||||||
.map(name => ({ name }));
|
.map(name => ({ name }));
|
||||||
|
|
||||||
if (!fs.existsSync(TEMP_PATH)) {
|
if (!fs.existsSync(TEMP_PATH))
|
||||||
fs.mkdirSync(TEMP_PATH);
|
fs.mkdirSync(TEMP_PATH);
|
||||||
}
|
|
||||||
|
|
||||||
for (const snippet of snippets) {
|
for (const snippet of snippets) {
|
||||||
snippet.data = fs.readFileSync(path.join(SNIPPETS_PATH, snippet.name), 'utf8');
|
snippet.data = fs.readFileSync(path.join(SNIPPETS_PATH, snippet.name), 'utf8');
|
||||||
@ -55,7 +55,7 @@ try {
|
|||||||
`semistandard "${TEMP_PATH}" --fix & ` +
|
`semistandard "${TEMP_PATH}" --fix & ` +
|
||||||
`prettier "${TEMP_PATH}/*.js" --single-quote --print-width=100 --write`;
|
`prettier "${TEMP_PATH}/*.js" --single-quote --print-width=100 --write`;
|
||||||
|
|
||||||
cp.exec(cmd, {}, (err, stdout, stderr) => {
|
cp.exec(cmd, {}, () => {
|
||||||
// Loop through each snippet now that semistandard and prettier did their job
|
// Loop through each snippet now that semistandard and prettier did their job
|
||||||
for (const snippet of snippets) {
|
for (const snippet of snippets) {
|
||||||
// an array to store each linted code block (definition + example)
|
// an array to store each linted code block (definition + example)
|
||||||
@ -77,7 +77,8 @@ try {
|
|||||||
console.log(`${chalk.green('SUCCESS!')} Snippet files linted!`);
|
console.log(`${chalk.green('SUCCESS!')} Snippet files linted!`);
|
||||||
console.timeEnd('Linter');
|
console.timeEnd('Linter');
|
||||||
});
|
});
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During linting: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During linting: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,22 +30,25 @@ tagDbStats = Object.entries(tagDbData).reduce((acc, val) => {
|
|||||||
}, {});
|
}, {});
|
||||||
// Update the listing of snippets in tag_database and log the statistics, along with missing scripts
|
// Update the listing of snippets in tag_database and log the statistics, along with missing scripts
|
||||||
try {
|
try {
|
||||||
for (let snippet of Object.entries(snippets))
|
for (let snippet of Object.entries(snippets)) {
|
||||||
if (
|
if (
|
||||||
tagDbData.hasOwnProperty(snippet[0].slice(0, -3)) &&
|
tagDbData.hasOwnProperty(snippet[0].slice(0, -3)) &&
|
||||||
tagDbData[snippet[0].slice(0, -3)].join(',').trim()
|
tagDbData[snippet[0].slice(0, -3)].join(',').trim()
|
||||||
)
|
) {
|
||||||
output += `${snippet[0].slice(0, -3)}:${tagDbData[snippet[0].slice(0, -3)]
|
output += `${snippet[0].slice(0, -3)}:${tagDbData[snippet[0].slice(0, -3)]
|
||||||
.join(',')
|
.join(',')
|
||||||
.trim()}\n`;
|
.trim()}\n`;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
output += `${snippet[0].slice(0, -3)}:uncategorized\n`;
|
output += `${snippet[0].slice(0, -3)}:uncategorized\n`;
|
||||||
missingTags++;
|
missingTags++;
|
||||||
console.log(`${chalk.yellow('Tagged uncategorized:')} ${snippet[0].slice(0, -3)}`);
|
console.log(`${chalk.yellow('Tagged uncategorized:')} ${snippet[0].slice(0, -3)}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Write to tag_database
|
// Write to tag_database
|
||||||
fs.writeFileSync('tag_database', output);
|
fs.writeFileSync('tag_database', output);
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
// Handle errors (hopefully not!)
|
// Handle errors (hopefully not!)
|
||||||
console.log(`${chalk.red('ERROR!')} During tag_database generation: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During tag_database generation: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
@ -31,7 +31,8 @@ const getFilesInDir = (directoryPath, withPath, exclude = null) => {
|
|||||||
}, []);
|
}, []);
|
||||||
}
|
}
|
||||||
return directoryFilenames;
|
return directoryFilenames;
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@ -45,7 +46,8 @@ const readSnippets = snippetsPath => {
|
|||||||
try {
|
try {
|
||||||
for (let snippet of snippetFilenames)
|
for (let snippet of snippetFilenames)
|
||||||
snippets[snippet] = fs.readFileSync(path.join(snippetsPath, snippet), 'utf8');
|
snippets[snippet] = fs.readFileSync(path.join(snippetsPath, snippet), 'utf8');
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During snippet loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@ -68,7 +70,8 @@ const readTags = () => {
|
|||||||
return data;
|
return data;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
// Handle errors (hopefully not!)
|
// Handle errors (hopefully not!)
|
||||||
console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During tag database loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@ -82,9 +85,9 @@ const optimizeNodes = (data, regexp, replacer) => {
|
|||||||
do {
|
do {
|
||||||
output = output.replace(regexp, replacer);
|
output = output.replace(regexp, replacer);
|
||||||
count = 0;
|
count = 0;
|
||||||
while (regexp.exec(output) !== null) {
|
while (regexp.exec(output) !== null)
|
||||||
++count;
|
++count;
|
||||||
}
|
|
||||||
} while (count > 0);
|
} while (count > 0);
|
||||||
return output;
|
return output;
|
||||||
};
|
};
|
||||||
@ -116,9 +119,9 @@ const getCodeBlocks = str => {
|
|||||||
const results = [];
|
const results = [];
|
||||||
let m = null;
|
let m = null;
|
||||||
while ((m = regex.exec(str)) !== null) {
|
while ((m = regex.exec(str)) !== null) {
|
||||||
if (m.index === regex.lastIndex) {
|
if (m.index === regex.lastIndex)
|
||||||
regex.lastIndex += 1;
|
regex.lastIndex += 1;
|
||||||
}
|
|
||||||
m.forEach((match, groupIndex) => {
|
m.forEach((match, groupIndex) => {
|
||||||
results.push(match);
|
results.push(match);
|
||||||
});
|
});
|
||||||
@ -131,9 +134,9 @@ const getTextualContent = str => {
|
|||||||
const results = [];
|
const results = [];
|
||||||
let m = null;
|
let m = null;
|
||||||
while ((m = regex.exec(str)) !== null) {
|
while ((m = regex.exec(str)) !== null) {
|
||||||
if (m.index === regex.lastIndex) {
|
if (m.index === regex.lastIndex)
|
||||||
regex.lastIndex += 1;
|
regex.lastIndex += 1;
|
||||||
}
|
|
||||||
m.forEach((match, groupIndex) => {
|
m.forEach((match, groupIndex) => {
|
||||||
results.push(match);
|
results.push(match);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -109,9 +109,10 @@ sass.render(
|
|||||||
if (!err2) console.log(`${chalk.green('SUCCESS!')} style.css file generated!`);
|
if (!err2) console.log(`${chalk.green('SUCCESS!')} style.css file generated!`);
|
||||||
else console.log(`${chalk.red('ERROR!')} During style.css file generation: ${err}`);
|
else console.log(`${chalk.red('ERROR!')} During style.css file generation: ${err}`);
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
console.log(`${chalk.red('ERROR!')} During style.css file generation: ${err}`);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
console.log(`${chalk.red('ERROR!')} During style.css file generation: ${err}`);
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// Set variables for paths
|
// Set variables for paths
|
||||||
@ -147,7 +148,8 @@ try {
|
|||||||
'static-page-start.html',
|
'static-page-start.html',
|
||||||
'static-page-end.html'
|
'static-page-end.html'
|
||||||
].map(filename => fs.readFileSync(path.join(staticPartsPath, filename), 'utf8'));
|
].map(filename => fs.readFileSync(path.join(staticPartsPath, filename), 'utf8'));
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
// Handle errors (hopefully not!)
|
// Handle errors (hopefully not!)
|
||||||
console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During static part loading: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@ -169,7 +171,7 @@ try {
|
|||||||
.replace(/<p>/g, '')
|
.replace(/<p>/g, '')
|
||||||
.replace(/<\/p>/g, '') +
|
.replace(/<\/p>/g, '') +
|
||||||
'</h4><ul>';
|
'</h4><ul>';
|
||||||
for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1][0] === tag))
|
for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1][0] === tag)) {
|
||||||
output += md
|
output += md
|
||||||
.render(
|
.render(
|
||||||
`[${taggedSnippet[0]}](./${
|
`[${taggedSnippet[0]}](./${
|
||||||
@ -179,6 +181,7 @@ try {
|
|||||||
.replace(/<p>/g, '')
|
.replace(/<p>/g, '')
|
||||||
.replace(/<\/p>/g, '</li>')
|
.replace(/<\/p>/g, '</li>')
|
||||||
.replace(/<a/g, `<li><a tags="${taggedSnippet[1].join(',')}"`);
|
.replace(/<a/g, `<li><a tags="${taggedSnippet[1].join(',')}"`);
|
||||||
|
}
|
||||||
output += '</ul>\n';
|
output += '</ul>\n';
|
||||||
}
|
}
|
||||||
output += `<h4 class="static-link"><a href="./archive">Archive</a></h4>
|
output += `<h4 class="static-link"><a href="./archive">Archive</a></h4>
|
||||||
@ -218,7 +221,7 @@ try {
|
|||||||
/<span class="token keyword">([^\0<]*?)<\/span>([\n\r\s]*)<span class="token keyword">([^\0]*?)<\/span>/gm,
|
/<span class="token keyword">([^\0<]*?)<\/span>([\n\r\s]*)<span class="token keyword">([^\0]*?)<\/span>/gm,
|
||||||
(match, p1, p2, p3) => `<span class="token keyword">${p1}${p2}${p3}</span>`
|
(match, p1, p2, p3) => `<span class="token keyword">${p1}${p2}${p3}</span>`
|
||||||
);
|
);
|
||||||
pagesOutput.push({ tag: tag, content: localOutput });
|
pagesOutput.push({ tag, content: localOutput });
|
||||||
}
|
}
|
||||||
// Minify output
|
// Minify output
|
||||||
pagesOutput.forEach(page => {
|
pagesOutput.forEach(page => {
|
||||||
@ -231,7 +234,8 @@ try {
|
|||||||
`${chalk.green('SUCCESS!')} ${page.tag === 'array' ? 'index' : page.tag}.html file generated!`
|
`${chalk.green('SUCCESS!')} ${page.tag === 'array' ? 'index' : page.tag}.html file generated!`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
// Handle errors (hopefully not!)
|
// Handle errors (hopefully not!)
|
||||||
console.log(`${chalk.red('ERROR!')} During category page generation: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During category page generation: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@ -251,7 +255,7 @@ const staticPageStartGenerator = (staticPart, heading, description) => {
|
|||||||
.replace(/<p>/g, '')
|
.replace(/<p>/g, '')
|
||||||
.replace(/<\/p>/g, '') +
|
.replace(/<\/p>/g, '') +
|
||||||
'</h4><ul>';
|
'</h4><ul>';
|
||||||
for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1][0] === tag))
|
for (let taggedSnippet of Object.entries(tagDbData).filter(v => v[1][0] === tag)) {
|
||||||
htmlCode += md
|
htmlCode += md
|
||||||
.render(
|
.render(
|
||||||
`[${taggedSnippet[0]}](./${
|
`[${taggedSnippet[0]}](./${
|
||||||
@ -261,6 +265,7 @@ const staticPageStartGenerator = (staticPart, heading, description) => {
|
|||||||
.replace(/<p>/g, '')
|
.replace(/<p>/g, '')
|
||||||
.replace(/<\/p>/g, '</li>')
|
.replace(/<\/p>/g, '</li>')
|
||||||
.replace(/<a/g, `<li><a tags="${taggedSnippet[1].join(',')}"`);
|
.replace(/<a/g, `<li><a tags="${taggedSnippet[1].join(',')}"`);
|
||||||
|
}
|
||||||
htmlCode += '</ul>\n';
|
htmlCode += '</ul>\n';
|
||||||
}
|
}
|
||||||
htmlCode += `<h4 class="static-link"><a href="./archive">Archive</a></h4>
|
htmlCode += `<h4 class="static-link"><a href="./archive">Archive</a></h4>
|
||||||
@ -271,13 +276,13 @@ const staticPageStartGenerator = (staticPart, heading, description) => {
|
|||||||
</nav><main class="col-centered"><span id="top"><br/><br/></span><h2 class="category-name">${heading}</h2>
|
</nav><main class="col-centered"><span id="top"><br/><br/></span><h2 class="category-name">${heading}</h2>
|
||||||
<p style="text-align: justify">${description}</p><br />`;
|
<p style="text-align: justify">${description}</p><br />`;
|
||||||
return htmlCode.replace(/\$page_name/g, util.capitalize(heading));
|
return htmlCode.replace(/\$page_name/g, util.capitalize(heading));
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// Create the output for the archive.html file
|
// Create the output for the archive.html file
|
||||||
try {
|
try {
|
||||||
// Add the static part
|
// Add the static part
|
||||||
let heading = "Snippets Archive";
|
let heading = 'Snippets Archive';
|
||||||
let description = "These snippets, while useful and interesting, didn't quite make it into the repository due to either having very specific use-cases or being outdated. However we felt like they might still be useful to some readers, so here they are.";
|
let description = "These snippets, while useful and interesting, didn't quite make it into the repository due to either having very specific use-cases or being outdated. However we felt like they might still be useful to some readers, so here they are.";
|
||||||
let htmlCode = staticPageStartGenerator(staticPageStartPart, heading, description);
|
let htmlCode = staticPageStartGenerator(staticPageStartPart, heading, description);
|
||||||
|
|
||||||
@ -316,7 +321,8 @@ try {
|
|||||||
|
|
||||||
fs.writeFileSync(path.join(docsPath, 'archive.html'), minifiedArchivedOutput);
|
fs.writeFileSync(path.join(docsPath, 'archive.html'), minifiedArchivedOutput);
|
||||||
console.log(`${chalk.green('SUCCESS!')} archive.html file generated!`);
|
console.log(`${chalk.green('SUCCESS!')} archive.html file generated!`);
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During archive.html generation: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During archive.html generation: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@ -324,8 +330,8 @@ try {
|
|||||||
// Create the output for the glossary.html file
|
// Create the output for the glossary.html file
|
||||||
try {
|
try {
|
||||||
// Add the static part
|
// Add the static part
|
||||||
let heading = "Glossary";
|
let heading = 'Glossary';
|
||||||
let description = "Developers use a lot of terminology daily. Every once in a while, you might find a term you do not know. We know how frustrating that can get, so we provide you with a handy glossary of frequently used web development terms.";
|
let description = 'Developers use a lot of terminology daily. Every once in a while, you might find a term you do not know. We know how frustrating that can get, so we provide you with a handy glossary of frequently used web development terms.';
|
||||||
let htmlCode = staticPageStartGenerator(staticPageStartPart, heading, description);
|
let htmlCode = staticPageStartGenerator(staticPageStartPart, heading, description);
|
||||||
glossaryOutput += htmlCode;
|
glossaryOutput += htmlCode;
|
||||||
|
|
||||||
@ -333,7 +339,7 @@ try {
|
|||||||
const filteredGlossarySnippets = filterSnippets(glossarySnippets, ['README.md']);
|
const filteredGlossarySnippets = filterSnippets(glossarySnippets, ['README.md']);
|
||||||
|
|
||||||
// Generate glossary snippets from md files
|
// Generate glossary snippets from md files
|
||||||
for (let snippet of Object.entries(filteredGlossarySnippets))
|
for (let snippet of Object.entries(filteredGlossarySnippets)) {
|
||||||
glossaryOutput +=
|
glossaryOutput +=
|
||||||
'<div class="card code-card"><div class="section card-content">' +
|
'<div class="card code-card"><div class="section card-content">' +
|
||||||
md
|
md
|
||||||
@ -341,6 +347,7 @@ try {
|
|||||||
.replace(/<h3/g, `<h4 id="${snippet[0].toLowerCase()}"`)
|
.replace(/<h3/g, `<h4 id="${snippet[0].toLowerCase()}"`)
|
||||||
.replace(/<\/h3>/g, '</h4>') +
|
.replace(/<\/h3>/g, '</h4>') +
|
||||||
'</div></div>';
|
'</div></div>';
|
||||||
|
}
|
||||||
|
|
||||||
glossaryOutput += `${staticPageEndPart}`;
|
glossaryOutput += `${staticPageEndPart}`;
|
||||||
|
|
||||||
@ -348,7 +355,8 @@ try {
|
|||||||
const minifiedGlossaryOutput = minifyHTML(glossaryOutput);
|
const minifiedGlossaryOutput = minifyHTML(glossaryOutput);
|
||||||
fs.writeFileSync(path.join(docsPath, 'glossary.html'), minifiedGlossaryOutput);
|
fs.writeFileSync(path.join(docsPath, 'glossary.html'), minifiedGlossaryOutput);
|
||||||
console.log(`${chalk.green('SUCCESS!')} glossary.html file generated!`);
|
console.log(`${chalk.green('SUCCESS!')} glossary.html file generated!`);
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During glossary.html generation: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During glossary.html generation: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
@ -358,7 +366,8 @@ staticFiles.forEach(f => {
|
|||||||
try {
|
try {
|
||||||
fs.copyFileSync(path.join(staticPartsPath, f), path.join(docsPath, f));
|
fs.copyFileSync(path.join(staticPartsPath, f), path.join(docsPath, f));
|
||||||
console.log(`${chalk.green('SUCCESS!')} ${f} file copied!`);
|
console.log(`${chalk.green('SUCCESS!')} ${f} file copied!`);
|
||||||
} catch (err) {
|
}
|
||||||
|
catch (err) {
|
||||||
console.log(`${chalk.red('ERROR!')} During ${f} copying: ${err}`);
|
console.log(`${chalk.red('ERROR!')} During ${f} copying: ${err}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user