git ssb

10+

Matt McKegg / patchwork



Commit 57dc1fb0228dd6a5ab98a2ef6d9d102ac02d540e

Remove commander dependency, just check if custom path passed in

Peter Squicciarini committed on 7/10/2018, 9:21:06 PM
Parent: 322cf9527ab94f96536f92a63ad982f647e1f6b9

Files changed

index.jschanged
package-lock.jsonchanged
package.jsonchanged
index.jsView
@@ -11,22 +11,15 @@
1111 var WindowState = require('electron-window-state')
1212 var Menu = electron.Menu
1313 var extend = require('xtend')
1414 var ssbKeys = require('ssb-keys')
15-var program = require('commander')
1615
1716 var windows = {
1817 dialogs: new Set()
1918 }
2019 var ssbConfig = null
2120 var quitting = false
2221
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-
2922 /**
3023 * It's not possible to run two instances of patchwork as it would create two
3124 * scuttlebot instances that conflict on the same port. Before opening patchwork,
3225 * we check if it's already running and if it is we focus the existing window
@@ -45,22 +38,18 @@
4538 electron.app.quit()
4639 }
4740 }
4841
49-quitIfAlreadyRunning()
50-
51-// pass program arguments into ssb-config
5242 var config = {
53- server: !program.useGlobalSsb
43 + server: !(process.argv.includes('-g') || process.argv.includes('--use-global-ssb'))
5444 }
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')) {
6047 config.customPath = true
6148 }
6249
50 +quitIfAlreadyRunning()
51 +
6352 electron.app.on('ready', () => {
6453 setupContext('ssb', config, () => {
6554 var browserWindow = openMainWindow()
6655 var menu = defaultMenu(electron.app, electron.shell)
package-lock.jsonView
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
package.jsonView
@@ -16,9 +16,8 @@
1616 "license": "AGPL-3.0",
1717 "dependencies": {
1818 "app-root-path": "^2.0.1",
1919 "bulk-require": "^1.0.1",
20- "commander": "^2.16.0",
2120 "compare-version": "^0.1.2",
2221 "cross-script": "^1.0.5",
2322 "deep-equal": "^1.0.1",
2423 "depject": "^4.1.1",

Built with git-ssb-web