mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-19 01:06:36 +00:00
Move package ignore list computation to a separate script (#285)
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
parent
2f65bd512f
commit
2b1ef3d980
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
ELECTRON_PACKAGER=./node_modules/.bin/electron-packager
|
ELECTRON_PACKAGER=./node_modules/.bin/electron-packager
|
||||||
ELECTRON_BUILDER=./node_modules/.bin/electron-builder
|
ELECTRON_BUILDER=./node_modules/.bin/electron-builder
|
||||||
ELECTRON_OSX_SIGN=./node_modules/.bin/electron-osx-sign
|
ELECTRON_OSX_SIGN=./node_modules/.bin/electron-osx-sign
|
||||||
ELECTRON_IGNORE=$(shell node -e "console.log(require('./package.json').packageIgnore.join('|'))")
|
ELECTRON_IGNORE=$(shell node scripts/packageignore.js)
|
||||||
ELECTRON_VERSION=0.36.11
|
ELECTRON_VERSION=0.36.11
|
||||||
ETCHER_VERSION=$(shell node -e "console.log(require('./package.json').version)")
|
ETCHER_VERSION=$(shell node -e "console.log(require('./package.json').version)")
|
||||||
APPLICATION_NAME=$(shell node -e "console.log(require('./package.json').displayName)")
|
APPLICATION_NAME=$(shell node -e "console.log(require('./package.json').displayName)")
|
||||||
|
17
package.json
17
package.json
@ -21,25 +21,16 @@
|
|||||||
"packageIgnore": [
|
"packageIgnore": [
|
||||||
"LICENSE",
|
"LICENSE",
|
||||||
"Makefile",
|
"Makefile",
|
||||||
"(.*)\\.md",
|
"(.*)\\.pem",
|
||||||
|
"(.*)\\.log",
|
||||||
|
"assets/osx",
|
||||||
"appveyor.yml",
|
"appveyor.yml",
|
||||||
"bower.json",
|
"bower.json",
|
||||||
"gulpfile.js",
|
"gulpfile.js",
|
||||||
"screenshot.png",
|
"screenshot.png",
|
||||||
"tests",
|
"tests",
|
||||||
"etcher-release",
|
"etcher-release",
|
||||||
"lib/scss",
|
"lib/scss"
|
||||||
"node_modules/electron-mocha",
|
|
||||||
"node_modules/electron-builder",
|
|
||||||
"node_modules/electron-osx-sign",
|
|
||||||
"node_modules/angular-mocks",
|
|
||||||
"node_modules/browserify",
|
|
||||||
"node_modules/gulp*",
|
|
||||||
"node_modules/jshint-stylish",
|
|
||||||
"node_modules/mochainon",
|
|
||||||
"node_modules/vinyl-*",
|
|
||||||
"node_modules/rindle",
|
|
||||||
"node_modules/tmp"
|
|
||||||
],
|
],
|
||||||
"builder": {
|
"builder": {
|
||||||
"win": {
|
"win": {
|
||||||
|
37
scripts/packageignore.js
Normal file
37
scripts/packageignore.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
|
||||||
|
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
|
||||||
|
_.filter(topLevelFiles, function(file) {
|
||||||
|
return _.startsWith(file, '.');
|
||||||
|
}),
|
||||||
|
|
||||||
|
// Top level markdown files
|
||||||
|
_.filter(topLevelFiles, function(file) {
|
||||||
|
return _.endsWith(file, '.md');
|
||||||
|
})
|
||||||
|
|
||||||
|
]).join('|'));
|
Loading…
x
Reference in New Issue
Block a user