Commit 57dc1fb0228dd6a5ab98a2ef6d9d102ac02d540e
Remove commander dependency, just check if custom path passed in
Peter Squicciarini committed on 7/10/2018, 9:21:06 PMParent: 322cf9527ab94f96536f92a63ad982f647e1f6b9
Files changed
index.js | changed |
package-lock.json | changed |
package.json | changed |
index.js | ||
---|---|---|
@@ -11,22 +11,15 @@ | ||
11 | 11 … | var WindowState = require('electron-window-state') |
12 | 12 … | var Menu = electron.Menu |
13 | 13 … | var extend = require('xtend') |
14 | 14 … | var ssbKeys = require('ssb-keys') |
15 | -var program = require('commander') | |
16 | 15 … | |
17 | 16 … | var windows = { |
18 | 17 … | dialogs: new Set() |
19 | 18 … | } |
20 | 19 … | var ssbConfig = null |
21 | 20 … | var quitting = false |
22 | 21 … | |
23 | -// parse program args | |
24 | -program | |
25 | - .option('-g, --use-global-ssb', 'Use a global instance of sbot (Patchwork starts its own instance by default)') | |
26 | - .option('-p, --path <path>', 'Use a specific path to database files (default is $HOME/.ssb)') | |
27 | - .parse(process.argv) | |
28 | - | |
29 | 22 … | /** |
30 | 23 … | * It's not possible to run two instances of patchwork as it would create two |
31 | 24 … | * scuttlebot instances that conflict on the same port. Before opening patchwork, |
32 | 25 … | * we check if it's already running and if it is we focus the existing window |
@@ -45,22 +38,18 @@ | ||
45 | 38 … | electron.app.quit() |
46 | 39 … | } |
47 | 40 … | } |
48 | 41 … | |
49 | -quitIfAlreadyRunning() | |
50 | - | |
51 | -// pass program arguments into ssb-config | |
52 | 42 … | var config = { |
53 | - server: !program.useGlobalSsb | |
43 … | + server: !(process.argv.includes('-g') || process.argv.includes('--use-global-ssb')) | |
54 | 44 … | } |
55 | -if (program.path) { | |
56 | - config.path = Path.resolve(program.path) | |
57 | - // currently git-ssb-web doesn't accept config options | |
58 | - // so a different path than the default would cause it to blow up | |
59 | - // so passing in a flag to server-process to skip launching it | |
45 … | +// a flag so we don't start git-ssb-web if a custom path is passed in | |
46 … | +if (process.argv.includes('--path')) { | |
60 | 47 … | config.customPath = true |
61 | 48 … | } |
62 | 49 … | |
50 … | +quitIfAlreadyRunning() | |
51 … | + | |
63 | 52 … | electron.app.on('ready', () => { |
64 | 53 … | setupContext('ssb', config, () => { |
65 | 54 … | var browserWindow = openMainWindow() |
66 | 55 … | var menu = defaultMenu(electron.app, electron.shell) |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 283507 bytes New file size: 283508 bytes |
Built with git-ssb-web