mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +00:00

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>
42 lines
997 B
JavaScript
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('|'));
|