Linted scripts

This commit is contained in:
Angelos Chalaris
2018-09-22 14:10:33 +03:00
parent b4de123e43
commit d3cf5a392a
7 changed files with 70 additions and 60 deletions

View File

@ -7,9 +7,7 @@ const cp = require('child_process');
const path = require('path');
const chalk = require('chalk');
const util = require('./util');
if (
util.isTravisCI() && util.isNotTravisCronOrAPI()
) {
if (util.isTravisCI() && util.isNotTravisCronOrAPI()) {
console.log(
`${chalk.green('NOBUILD')} Module build terminated, not a cron job or a custom build!`
);
@ -55,9 +53,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);