Permalink
Browse files

Add fix for osx build output names

  • Loading branch information...
pfrazee committed Nov 2, 2017
1 parent ac2a3cb commit a2632cc2379d677303364028321700b7cf7b847c
Showing with 23 additions and 4 deletions.
  1. +4 −3 gulpfile.js
  2. +1 −1 package.json
  3. +18 −0 tasks/postbuild.js
View
@@ -1,5 +1,6 @@
'use strict';
require('./tasks/build/build');
require('./tasks/start');
require('./tasks/rebuild')
require('./tasks/build/build')
require('./tasks/start')
require('./tasks/rebuild')
require('./tasks/postbuild')
View
@@ -58,7 +58,7 @@
"burnthemall": "node ./tasks/burnthemall.js",
"lint": "eslint --ignore-pattern 'color-thief.js' --ignore-pattern 'app/node_modules' --ignore-pattern '*.build.js' app",
"rebuild": "gulp rebuild",
"release": "npm run build && build -p never",
"release": "npm run build && build -p never && gulp postbuild",
"start": "gulp start",
"start-logging": "DEBUG=*,-bittorrent-dht $(node -e \"console.log(require('electron'))\") -r trace ./app",
"watch": "gulp start-watch"
View
@@ -0,0 +1,18 @@
const gulp = require('gulp')
const jetpack = require('fs-jetpack')
const run = require('./util-run')
gulp.task('postbuild', async () => {
// OSX - for some reason, electron-builder is spitting out 'Beaker Browser-{version}{ext}'
// but the auto updater expects 'beaker-browser-{version}{ext}'
// so auto-rename any files like that
const cwd = jetpack.cwd('dist')
const names = await cwd.listAsync()
await Promise.all(names.map(name => {
if (name.startsWith('Beaker Browser')) {
const newName = 'beaker-browser' + name.slice('Beaker Browser'.length)
return cwd.move(name, newName)
}
}))
})

0 comments on commit a2632cc

Please sign in to comment.