etcher/scripts/packageignore.js
Juan Cruz Viotti ea1df5cc11 chore: make use of ESLint (#540)
JSCS has merged with ESLint. This is the perfect excuse to move to
ESLint and unify both JSHint and JSCS hints under ESLint.

This PR also deprecates `gulp lint` in favour of `npm run lint`.

See: https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2#.zbuwvxa5y
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-06-30 20:09:44 +05:30

42 lines
997 B
JavaScript

/**
* This script is in charge of building a regex of files to ignore
* when packaging for `electron-packager`'s `ignore` option.
*
* See https://github.com/electron-userland/electron-packager/blob/master/usage.txt
*
* Usage:
*
* node scripts/packageignore.js
*/
'use strict';
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const packageJSON = require('../package.json');
const topLevelFiles = fs.readdirSync(path.join(__dirname, '..'));
console.log(_.flatten([
packageJSON.packageIgnore,
// Development dependencies
_.map(_.keys(packageJSON.devDependencies), function(dependency) {
return path.join('node_modules', dependency);
}),
// Top level hidden files
_.map(_.filter(topLevelFiles, function(file) {
return _.startsWith(file, '.');
}), function(file) {
return '\\' + file;
}),
// Top level markdown files
_.filter(topLevelFiles, function(file) {
return _.endsWith(file, '.md');
})
]).join('|'));