git ssb

10+

Matt McKegg / patchwork



Commit 6eb010cb892ec11bfc1f1fea84e926aafa2de165

Merge branch 'master' of https://github.com/ssbc/patchwork

Matt McKegg committed on 7/14/2018, 11:38:45 PM
Parent: 651a6cdd44ceb9cf10030251a473d6c41ef1955c
Parent: bd6ae13c2995c4eadfe1d7e1c04489af84bebda4

Files changed

index.jschanged
server-process.jschanged
index.jsView
@@ -38,14 +38,20 @@
3838 electron.app.quit()
3939 }
4040 }
4141
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 +
4250 quitIfAlreadyRunning()
4351
4452 electron.app.on('ready', () => {
45- setupContext('ssb', {
46- server: !(process.argv.includes('-g') || process.argv.includes('--use-global-ssb'))
47- }, () => {
53 + setupContext('ssb', config, () => {
4854 var browserWindow = openMainWindow()
4955 var menu = defaultMenu(electron.app, electron.shell)
5056
5157 menu.splice(4, 0, {
server-process.jsView
@@ -32,15 +32,18 @@
3232 ssbConfig.manifest = context.sbot.getManifest()
3333 fs.writeFileSync(Path.join(ssbConfig.path, 'manifest.json'), JSON.stringify(ssbConfig.manifest))
3434 electron.ipcRenderer.send('server-started', ssbConfig)
3535
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 + }
4649 }

Built with git-ssb-web