From 180d756dc0bc9748c37df7765fb2f528347bff8f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 25 Mar 2016 04:27:20 -0700 Subject: [PATCH] OS X packager: Fix missing DMG background image Remove previous DMG file. This somehow fixes the issue. --- bin/package.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/package.js b/bin/package.js index b29f4d85..70237099 100755 --- a/bin/package.js +++ b/bin/package.js @@ -10,6 +10,7 @@ var electronPackager = require('electron-packager') var fs = require('fs') var path = require('path') var pkg = require('../package.json') +var rimraf = require('rimraf') var BUILD_NAME = config.APP_NAME + '-v' + config.APP_VERSION @@ -213,10 +214,13 @@ function buildDarwin (cb) { cp.execSync(`pushd ${buildPath[0]} && zip -r -y ${zipPath} ${config.APP_NAME + '.app'} && popd`) console.log('Created OS X .zip file.') + var targetPath = path.join(config.ROOT_PATH, 'dist', BUILD_NAME + '.dmg') + rimraf.sync(targetPath) + // Create a .dmg (OS X disk image) file, for easy user installation. var dmgOpts = { basepath: config.ROOT_PATH, - target: path.join(config.ROOT_PATH, 'dist', BUILD_NAME + '.dmg'), + target: targetPath, specification: { title: config.APP_NAME, icon: config.APP_ICON + '.icns',