mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 14:14:22 +01:00
@@ -9,6 +9,7 @@ const Hyperdrive = require('hyperdrive')
|
|||||||
const crypto = require('hypercore-crypto')
|
const crypto = require('hypercore-crypto')
|
||||||
|
|
||||||
const git = require('./git.js')
|
const git = require('./git.js')
|
||||||
|
const home = require('./home')
|
||||||
|
|
||||||
const url = process.argv[3]
|
const url = process.argv[3]
|
||||||
const matches = url.match(/pear:\/\/([a-f0-9]{64})\/(.*)/)
|
const matches = url.match(/pear:\/\/([a-f0-9]{64})\/(.*)/)
|
||||||
@@ -80,6 +81,14 @@ async function talkToGit (refs, drive) {
|
|||||||
const isDelete = !src
|
const isDelete = !src
|
||||||
const isForce = src.startsWith('+')
|
const isForce = src.startsWith('+')
|
||||||
|
|
||||||
|
if (!home.getDaemonPid()) {
|
||||||
|
const daemon = spawn('git-peard', opts)
|
||||||
|
home.storeDaemonPid(daemon.pid)
|
||||||
|
// TODO: remove in case of error or exit but allow unref
|
||||||
|
// daemon.on('error', home.removeDaemonPid)
|
||||||
|
// daemon.on('exit', home.removeDaemonPid)
|
||||||
|
daemon.unref()
|
||||||
|
}
|
||||||
// TODO: options:
|
// TODO: options:
|
||||||
// ---- push by pull ----
|
// ---- push by pull ----
|
||||||
// - init for share (daemon, etc)
|
// - init for share (daemon, etc)
|
||||||
|
|||||||
Reference in New Issue
Block a user