Commit 6eb010cb892ec11bfc1f1fea84e926aafa2de165
Merge branch 'master' of https://github.com/ssbc/patchwork
Matt McKegg committed on 7/14/2018, 11:38:45 PMParent: 651a6cdd44ceb9cf10030251a473d6c41ef1955c
Parent: bd6ae13c2995c4eadfe1d7e1c04489af84bebda4
Files changed
index.js | changed |
server-process.js | changed |
index.js | ||
---|---|---|
@@ -38,14 +38,20 @@ | ||
38 | 38 … | electron.app.quit() |
39 | 39 … | } |
40 | 40 … | } |
41 | 41 … | |
42 … | +var config = { | |
43 … | + server: !(process.argv.includes('-g') || process.argv.includes('--use-global-ssb')) | |
44 … | +} | |
45 … | +// a flag so we don't start git-ssb-web if a custom path is passed in | |
46 … | +if (process.argv.includes('--path')) { | |
47 … | + config.customPath = true | |
48 … | +} | |
49 … | + | |
42 | 50 … | quitIfAlreadyRunning() |
43 | 51 … | |
44 | 52 … | electron.app.on('ready', () => { |
45 | - setupContext('ssb', { | |
46 | - server: !(process.argv.includes('-g') || process.argv.includes('--use-global-ssb')) | |
47 | - }, () => { | |
53 … | + setupContext('ssb', config, () => { | |
48 | 54 … | var browserWindow = openMainWindow() |
49 | 55 … | var menu = defaultMenu(electron.app, electron.shell) |
50 | 56 … | |
51 | 57 … | menu.splice(4, 0, { |
server-process.js | ||
---|---|---|
@@ -32,15 +32,18 @@ | ||
32 | 32 … | ssbConfig.manifest = context.sbot.getManifest() |
33 | 33 … | fs.writeFileSync(Path.join(ssbConfig.path, 'manifest.json'), JSON.stringify(ssbConfig.manifest)) |
34 | 34 … | electron.ipcRenderer.send('server-started', ssbConfig) |
35 | 35 … | |
36 | - // attempt to run git-ssb if it is installed and in path | |
37 | - var gitSsb = spawn('git-ssb', [ 'web' ], { | |
38 | - stdio: 'inherit' | |
39 | - }) | |
40 | - gitSsb.on('error', () => { | |
41 | - console.log('git-ssb is not installed, or not available in path') | |
42 | - }) | |
43 | - process.on('exit', () => { | |
44 | - gitSsb.kill() | |
45 | - }) | |
36 … | + // check if we are using a custom ssb path (which would break git-ssb-web) | |
37 … | + if (!ssbConfig.customPath) { | |
38 … | + // attempt to run git-ssb if it is installed and in path | |
39 … | + var gitSsb = spawn('git-ssb', [ 'web' ], { | |
40 … | + stdio: 'inherit' | |
41 … | + }) | |
42 … | + gitSsb.on('error', () => { | |
43 … | + console.log('git-ssb is not installed, or not available in path') | |
44 … | + }) | |
45 … | + process.on('exit', () => { | |
46 … | + gitSsb.kill() | |
47 … | + }) | |
48 … | + } | |
46 | 49 … | } |
Built with git-ssb-web