Browse Source

add assets and config for packaging

Paul Frazee 4 years ago
parent
commit
af5b5c5706
12 changed files with 61 additions and 4 deletions
  1. 15
    0
      README.md
  2. 0
    0
      app/icon.png
  3. 1
    1
      app/index.js
  4. BIN
      assets/.DS_Store
  5. BIN
      assets/icon.pxm
  6. BIN
      assets/icon1024.png
  7. BIN
      assets/osx/installer.png
  8. BIN
      assets/osx/scuttlebot.icns
  9. BIN
      assets/win/scuttlebot.ico
  10. 15
    3
      package.json
  11. 16
    0
      packager.json
  12. 14
    0
      scripts/make-icns.sh

+ 15
- 0
README.md View File

@@ -0,0 +1,15 @@
1
+# Electron Scuttlebot
2
+
3
+Code for wrapping scuttlebot in a small Electron UI, and to create app packages and installers.
4
+
5
+```
6
+npm install -d
7
+npm run build
8
+npm run pack
9
+```
10
+
11
+Relevant docs:
12
+
13
+ - https://github.com/maxogden/electron-packager
14
+ - https://github.com/loopline-systems/electron-builder
15
+ - https://github.com/atom/electron/tree/master/docs

icon.png → app/icon.png View File


index.js → app/index.js View File

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

BIN
assets/.DS_Store View File


BIN
assets/icon.pxm View File


BIN
assets/icon1024.png View File


BIN
assets/osx/installer.png View File


BIN
assets/osx/scuttlebot.icns View File


BIN
assets/win/scuttlebot.ico View File


+ 15
- 3
package.json View File

@@ -2,13 +2,25 @@
2 2
   "name": "electron-scuttlebot",
3 3
   "version": "1.0.0",
4 4
   "description": "",
5
-  "main": "index.js",
5
+  "main": "app/index.js",
6 6
   "scripts": {
7
-    "start": "electron ."
7
+    "start": "electron .",
8
+    "clean": "rm -rf ./dist",
9
+    "clean:osx": "rm -rf ./dist/osx",
10
+    "clean:win": "rm -rf ./dist/win",
11
+    "build": "npm run clean && npm run build:osx && npm run build:win",
12
+    "build:icon": "./scripts/make-icns.sh assets/icon1024.png assets/osx/scuttlebot.icns",
13
+    "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",
14
+    "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",
15
+    "pack": "npm run pack:osx && npm run pack:win",
16
+    "pack:osx": "electron-builder \"dist/osx/Scuttlebot.app\" --platform=osx --out=\"dist/osx\" --config=packager.json",
17
+    "pack:win": "electron-builder \"dist/win/Scuttlebot-win32\" --platform=win --out=\"dist/win\" --config=packager.json"
8 18
   },
9
-  "author": "",
19
+  "author": "Paul Frazee <pfrazee@gmail.com>",
10 20
   "license": "?",
11 21
   "devDependencies": {
22
+    "electron-builder": "^2.0.0",
23
+    "electron-packager": "^4.1.3",
12 24
     "electron-prebuilt": "^0.28.2"
13 25
   },
14 26
   "dependencies": {

+ 16
- 0
packager.json View File

@@ -0,0 +1,16 @@
1
+{
2
+  "osx" : {
3
+    "title": "Secure Scuttlebot",
4
+    "background": "assets/osx/installer.png",
5
+    "icon": "assets/osx/scuttlebot.icns",
6
+    "icon-size": 80,
7
+    "contents": [
8
+      { "x": 438, "y": 344, "type": "link", "path": "/Applications" },
9
+      { "x": 192, "y": 344, "type": "file" }
10
+    ]
11
+  },
12
+  "win" : {
13
+    "title" : "Secure Scuttlebot",
14
+    "icon" : "assets/win/scuttlebot.ico"
15
+  }
16
+}

+ 14
- 0
scripts/make-icns.sh View File

@@ -0,0 +1,14 @@
1
+#!/bin/sh
2
+mkdir /tmp/icon.iconset
3
+sips -z 16 16     $1 --out /tmp/icon.iconset/icon_16x16.png
4
+sips -z 32 32     $1 --out /tmp/icon.iconset/icon_16x16@2x.png
5
+sips -z 32 32     $1 --out /tmp/icon.iconset/icon_32x32.png
6
+sips -z 64 64     $1 --out /tmp/icon.iconset/icon_32x32@2x.png
7
+sips -z 128 128   $1 --out /tmp/icon.iconset/icon_128x128.png
8
+sips -z 256 256   $1 --out /tmp/icon.iconset/icon_128x128@2x.png
9
+sips -z 256 256   $1 --out /tmp/icon.iconset/icon_256x256.png
10
+sips -z 512 512   $1 --out /tmp/icon.iconset/icon_256x256@2x.png
11
+sips -z 512 512   $1 --out /tmp/icon.iconset/icon_512x512.png
12
+cp $1 /tmp/icon.iconset/icon_512x512@2x.png
13
+iconutil -c icns --output $2 /tmp/icon.iconset
14
+rm -R /tmp/icon.iconset

Loading…
Cancel
Save