Codacy update for scripts

This commit is contained in:
Angelos Chalaris
2018-09-15 13:20:54 +03:00
parent 17d64598e8
commit 3b75e60b60
3 changed files with 24 additions and 156 deletions

View File

@ -57,9 +57,9 @@ try {
// Store the data to be written
const toWrite = isNodeSnippet
? `${code
.replace(`const ${snippetName}`, `export const ${snippetName}`)
// Prevents errors from being thrown in browser environment
.replace('require(', 'typeof require !== "undefined" && require(')}`
.replace(`const ${snippetName}`, `export const ${snippetName}`)
// Prevents errors from being thrown in browser environment
.replace('require(', 'typeof require !== "undefined" && require(')}`
: `export ${code}`;
// Write data to the proper file
fs.writeFileSync(`${TEMP_PATH}/${snippetName}.js`, toWrite);