add assets and config for packaging

This commit is contained in:
Paul Frazee 2015-06-24 12:24:53 -05:00
parent 7dbf0b46a5
commit af5b5c5706
12 changed files with 61 additions and 4 deletions

15
README.md Normal file
View File

@ -0,0 +1,15 @@
# Electron Scuttlebot
Code for wrapping scuttlebot in a small Electron UI, and to create app packages and installers.
```
npm install -d
npm run build
npm run pack
```
Relevant docs:
- https://github.com/maxogden/electron-packager
- https://github.com/loopline-systems/electron-builder
- https://github.com/atom/electron/tree/master/docs

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -14,7 +14,7 @@ app.on('ready', function ready () {
require('scuttlebot').init(config, function (err, sbot) { require('scuttlebot').init(config, function (err, sbot) {
// setup tray icon // setup tray icon
tray = new Tray('./icon.png') tray = new Tray(__dirname+'/icon.png')
var contextMenu = Menu.buildFromTemplate([ var contextMenu = Menu.buildFromTemplate([
{ label: 'Open App', click: onopen }, { label: 'Open App', click: onopen },
{ label: 'Quit', click: onquit } { label: 'Quit', click: onquit }

BIN
assets/.DS_Store vendored Normal file

Binary file not shown.

BIN
assets/icon.pxm Normal file

Binary file not shown.

BIN
assets/icon1024.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
assets/osx/installer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
assets/osx/scuttlebot.icns Normal file

Binary file not shown.

BIN
assets/win/scuttlebot.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -2,13 +2,25 @@
"name": "electron-scuttlebot", "name": "electron-scuttlebot",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "index.js", "main": "app/index.js",
"scripts": { "scripts": {
"start": "electron ." "start": "electron .",
"clean": "rm -rf ./dist",
"clean:osx": "rm -rf ./dist/osx",
"clean:win": "rm -rf ./dist/win",
"build": "npm run clean && npm run build:osx && npm run build:win",
"build:icon": "./scripts/make-icns.sh assets/icon1024.png assets/osx/scuttlebot.icns",
"build:osx": "npm run clean:osx && electron-packager ./ \"Scuttlebot\" --out=dist/osx --platform=darwin --arch=x64 --ignore=node_modules/electron* --version=0.28.3 --icon=assets/osx/scuttlebot.icns",
"build:win": "npm run clean:win && electron-packager ./ \"Scuttlebot\" --out=dist/win --platform=win32 --arch=ia32 --ignore=node_modules/electron* --version=0.28.3 --icon=assets/win/scuttlebot.ico",
"pack": "npm run pack:osx && npm run pack:win",
"pack:osx": "electron-builder \"dist/osx/Scuttlebot.app\" --platform=osx --out=\"dist/osx\" --config=packager.json",
"pack:win": "electron-builder \"dist/win/Scuttlebot-win32\" --platform=win --out=\"dist/win\" --config=packager.json"
}, },
"author": "", "author": "Paul Frazee <pfrazee@gmail.com>",
"license": "?", "license": "?",
"devDependencies": { "devDependencies": {
"electron-builder": "^2.0.0",
"electron-packager": "^4.1.3",
"electron-prebuilt": "^0.28.2" "electron-prebuilt": "^0.28.2"
}, },
"dependencies": { "dependencies": {

16
packager.json Normal file
View File

@ -0,0 +1,16 @@
{
"osx" : {
"title": "Secure Scuttlebot",
"background": "assets/osx/installer.png",
"icon": "assets/osx/scuttlebot.icns",
"icon-size": 80,
"contents": [
{ "x": 438, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file" }
]
},
"win" : {
"title" : "Secure Scuttlebot",
"icon" : "assets/win/scuttlebot.ico"
}
}

14
scripts/make-icns.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
mkdir /tmp/icon.iconset
sips -z 16 16 $1 --out /tmp/icon.iconset/icon_16x16.png
sips -z 32 32 $1 --out /tmp/icon.iconset/icon_16x16@2x.png
sips -z 32 32 $1 --out /tmp/icon.iconset/icon_32x32.png
sips -z 64 64 $1 --out /tmp/icon.iconset/icon_32x32@2x.png
sips -z 128 128 $1 --out /tmp/icon.iconset/icon_128x128.png
sips -z 256 256 $1 --out /tmp/icon.iconset/icon_128x128@2x.png
sips -z 256 256 $1 --out /tmp/icon.iconset/icon_256x256.png
sips -z 512 512 $1 --out /tmp/icon.iconset/icon_256x256@2x.png
sips -z 512 512 $1 --out /tmp/icon.iconset/icon_512x512.png
cp $1 /tmp/icon.iconset/icon_512x512@2x.png
iconutil -c icns --output $2 /tmp/icon.iconset
rm -R /tmp/icon.iconset