Linted scripts
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user