git ssb

2+

mixmix / ticktack



Tree: c0a64989f4157a9fd83067b87859a94b12675f90

Files: c0a64989f4157a9fd83067b87859a94b12675f90 / backup / async / importIdentity.js

683 bytesRaw
1const nest = require('depnest')
2const { onceTrue } = require('mutant')
3const path = require('path')
4const fs = require('fs')
5const os = require('os')
6const config = require('../../config').create().config.sync.load()
7const peersFile = path.join(config.path, "gossip.json")
8const secretFile = path.join(config.path, "secret")
9
10// TODO: files should take into account env vars
11
12exports.gives = nest('backup.async.importIdentity')
13
14exports.create = function (api) {
15 return nest('backup.async.importIdentity', (importData, cb) => {
16
17 fs.writeFileSync(peersFile, JSON.stringify(importData.peers), "utf8")
18 fs.writeFileSync(secretFile, importData.secret, "utf8")
19
20 cb()
21
22 })
23}
24

Built with git-ssb-web