git ssb

2+

arj / dat-share



Commit 1b9093405deadf26da6cab9aefb5cdf7ec500421

Fix indention

Anders Rune Jensen committed on 9/19/2017, 12:37:43 PM
Parent: a1a4821bd547e1257c2506c9f0e0e5d0f93deb65

Files changed

index.jschanged
index.jsView
@@ -9,40 +9,40 @@
99 .option('-f, --folder [value]', 'Folder for sharing')
1010 .parse(process.argv);
1111
1212 require('ssb-client')((err, sbot) => {
13- if (err) throw err;
13 + if (err) throw err;
1414
15- console.log("Looking for dat links")
16-
17- pull(
18- sbot.createLogStream({ reverse: true, limit: 10000 }),
19- pull.filter((msg) => {
20- return !msg.value ||
21- msg.value.content.type == 'post' &&
22- typeof msg.value.content.text == "string" &&
23- msg.value.content.text.indexOf("dat://") != -1
24- }),
25- pull.collect((err, log) => {
26- if (err) throw err;
15 + console.log("Looking for dat links")
2716
28- console.log("Found " + log.length)
17 + pull(
18 + sbot.createLogStream({ reverse: true, limit: 10000 }),
19 + pull.filter((msg) => {
20 + return !msg.value ||
21 + msg.value.content.type == 'post' &&
22 + typeof msg.value.content.text == "string" &&
23 + msg.value.content.text.indexOf("dat://") != -1
24 + }),
25 + pull.collect((err, log) => {
26 + if (err) throw err;
27 +
28 + console.log("Found " + log.length)
29 +
30 + log.forEach(msg => {
31 + uri.withinString(msg.value.content.text, (datLink) => {
32 + if (!datLink.startsWith("dat://")) return
33 +
34 + console.log("Saving to:", program.folder + "/" + datLink.substring(6))
35 +
36 + Dat(program.folder + "/" + datLink.substring(6), {
37 + key: datLink
38 + }, function (err, dat) {
39 + if (err) throw err
2940
30- log.forEach(msg => {
31- uri.withinString(msg.value.content.text, (datLink) => {
32- if (!datLink.startsWith("dat://")) return
33-
34- console.log("Saving to:", program.folder + "/" + datLink.substring(6))
35-
36- Dat(program.folder + "/" + datLink.substring(6), {
37- key: datLink
38- }, function (err, dat) {
39- if (err) throw err
40-
41- console.log("sharing:", datLink)
42- dat.joinNetwork()
43- })
44- })
45- })
41 + console.log("sharing:", datLink)
42 + dat.joinNetwork()
43 + })
4644 })
47- )
45 + })
46 + })
47 + )
4848 })

Built with git-ssb-web