git ssb

10+

Matt McKegg / patchwork



Commit bd6ae13c2995c4eadfe1d7e1c04489af84bebda4

Merge pull request #829 from stripedpajamas/custom-path

Add support for custom ssb path
Matt McKegg authored on 7/11/2018, 6:05:27 AM
GitHub committed on 7/11/2018, 6:05:27 AM
Parent: dde0f66d805ad433984e8d28ac8554e739f47ec7
Parent: 57dc1fb0228dd6a5ab98a2ef6d9d102ac02d540e

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