Now builds DMG.

This commit is contained in:
Kylart 2017-04-26 00:27:27 +02:00
parent 1436cb6ddb
commit 12fb4eb2fd
3 changed files with 38 additions and 5 deletions

4
.gitignore vendored
View File

@ -13,8 +13,8 @@ dist
# Mac OS
.DS_Store
# Electron-packager
KawAnime-*
# Dist
assets/build/dists/KawAnime*
# Idea directory
.idea

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 452 KiB

View File

@ -18,7 +18,12 @@
const {join} = require('path')
// packages
const packager = require('electron-packager')
const materialPath = join(__dirname, '..', 'build', 'material')
// Installers
const createDMG = require('electron-installer-dmg')
const colors = require('colors')
@ -28,18 +33,46 @@ const packOptions = {
out: join(__dirname, '..', 'build', 'dists'),
appCopyright: `© 2016 - ${(new Date()).getYear() + 1900} Kylart`,
all: true,
icon: join(__dirname, '..', 'build', 'material', 'icon'),
icon: join(materialPath, 'icon'),
overwrite: true
// Check for signing app
}
const buildDists = () => {
const dmgOptions = {
appPath: join(materialPath, '..', 'dists', 'KawAnime-darwin-x64', 'KawAnime.app'),
name: 'KawAnime',
background: join(materialPath, 'background.png'),
icon: join(materialPath, 'icon.icns'),
overwrite: true,
out: join(materialPath, '..', 'dists'),
"icon-size": 80
}
const makeDMG = () => {
console.log('[Builder]: Creating DMG...'.yellow)
createDMG(dmgOptions, function done(err) {
if (err)
{
console.log('[Builder]: An error occurred while creating DMG.'.red)
throw err
}
console.log('[Builder]: Successfully built DMG!'.green)
})
}
const buildDists = () => {
makeDMG()
}
const pack = () => {
packager(packOptions, function done_callback(err, appPaths) {
if (err) throw err
if (err)
{
console.log('[Builder]: An occurred while packaging KawAnime!'.red)
throw err
}
appPaths.forEach((path) => {
console.log(`[Builder]: Successfully built ${path}!`.green)