git ssb

0+

clemo / ssb-ipfs-share



forked from arj / dat-share

Tree: 1071bfd3ef35fb108626276bc967d1478e72f702

Files: 1071bfd3ef35fb108626276bc967d1478e72f702 / bin.js

827 bytesRaw
1#!/usr/bin/env node
2
3const path = require('path');
4const index = require('./index.js');
5const createConfig = require('ssb-config/inject');
6const defined = require('defined');
7const program = require('commander');
8
9program
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);
17let 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};
25require('ssb-client')((err, sbot) => {
26 if (err) throw err;
27 index.init(sbot, config);
28});
29

Built with git-ssb-web