mirror of https://github.com/Kylart/KawAnime.git
Now builds DMG.
This commit is contained in:
parent
1436cb6ddb
commit
12fb4eb2fd
|
@ -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 |
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue