Files: 1071bfd3ef35fb108626276bc967d1478e72f702 / bin.js
827 bytesRaw
1 | |
2 | |
3 | const path = require('path'); |
4 | const index = require('./index.js'); |
5 | const createConfig = require('ssb-config/inject'); |
6 | const defined = require('defined'); |
7 | const program = require('commander'); |
8 | |
9 | program |
10 | .option('-a, --no-friends', |
11 | 'pin all ipfs Hashes') |
12 | .option('-h, --hops <n>', |
13 | 'amount of hops to follow (-a for all)', parseInt) |
14 | .option('-t --timeout <s>', 'ipfs pin timeout (default "180s")') |
15 | .option('-f --folder <folder>', 'meta data folder (default to ~/.ssb/ )') |
16 | .parse(process.argv); |
17 | let config = { |
18 | ipfsShare: { |
19 | onlyPeopleIFollow: program.friends, |
20 | hops: program.hops, |
21 | timeout: program.timeout, |
22 | folder: defined(program.folder, path.join(process.env.HOME, '/.ssb')) |
23 | } |
24 | }; |
25 | require('ssb-client')((err, sbot) => { |
26 | if (err) throw err; |
27 | index.init(sbot, config); |
28 | }); |
29 |
Built with git-ssb-web