Files: ea79be30c19ff39f8cb158ff14d32c066c4134c5 / modules / app / sync / external-handler / git.js
528 bytesRaw
1 | const nest = require('depnest') |
2 | const {shell} = require('electron') |
3 | |
4 | exports.gives = nest('app.sync.externalHandler') |
5 | |
6 | var viewer = 'http://git.scuttlebot.io' |
7 | var gitMessageTypes = [ |
8 | 'git-repo', |
9 | 'git-update', |
10 | 'issue', |
11 | 'issue-edit', |
12 | 'pull-request' |
13 | ] |
14 | |
15 | exports.create = (api) => { |
16 | return nest('app.sync.externalHandler', function (msg) { |
17 | if (!gitMessageTypes.includes(msg.value.content.type)) return |
18 | return function gitHandler (id) { |
19 | shell.openExternal(`${viewer}/${encodeURIComponent(id)}`) |
20 | } |
21 | }) |
22 | } |
23 |
Built with git-ssb-web