React: fix package script

This commit is contained in:
DC
2016-07-22 19:57:06 -07:00
parent 793ea79cab
commit d20786cd69
5 changed files with 12 additions and 3 deletions

View File

@@ -13,8 +13,14 @@ var rimraf = require('rimraf')
var config = require('../config')
var handlers = require('../main/handlers')
// First, remove generated files
rimraf.sync('build/')
rimraf.sync('dist/')
// Remove any saved configuration
rimraf.sync(config.CONFIG_PATH)
// Remove any temporary files
var tmpPath
try {
tmpPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent')

View File

@@ -19,6 +19,7 @@ var config = require('../src/config')
var pkg = require('../package.json')
var BUILD_NAME = config.APP_NAME + '-v' + config.APP_VERSION
var BUILD_PATH = path.join(config.ROOT_PATH, 'build')
var DIST_PATH = path.join(config.ROOT_PATH, 'dist')
var argv = minimist(process.argv.slice(2), {

View File

@@ -82,7 +82,7 @@
"scripts": {
"clean": "node ./bin/clean.js",
"open-config": "node ./bin/open-config.js",
"package": "node ./bin/package.js",
"package": "rm -rf build/ && jsx --es6module src/ build/ && node ./bin/package.js",
"start": "jsx --es6module src/ build/ && electron .",
"test": "standard && node ./bin/check-deps.js",
"update-authors": "./bin/update-authors.sh"

View File

@@ -66,7 +66,7 @@ module.exports = {
IS_PRODUCTION: isProduction(),
POSTER_PATH: path.join(getConfigPath(), 'Posters'),
ROOT_PATH: __dirname,
ROOT_PATH: path.join(__dirname, '..'),
STATIC_PATH: path.join(__dirname, '..', 'static'),
TORRENT_PATH: path.join(getConfigPath(), 'Torrents'),

View File

@@ -22,9 +22,11 @@ var windows = require('./windows')
var shouldQuit = false
var argv = sliceArgv(process.argv)
if (!argv.includes('--dev')) process.env.NODE_ENV = 'production'
if (process.platform === 'win32') {
shouldQuit = squirrelWin32.handleEvent(argv[0])
argv = argv.filter((arg) => arg.indexOf('--squirrel') === -1)
argv = argv.filter((arg) => !arg.includes('--squirrel'))
}
if (!shouldQuit) {