git ssb

0+

cel / ssb-wikimedia



Commit 86215c0311074ce998b6e5f88651f86e3d5e7a1e

Handle empty revisions list

cel committed on 12/1/2019, 5:24:50 AM
Parent: 3e16d9e26cb2f5204c569b42349451a6900adeda

Files changed

bin.jschanged
bin.jsView
@@ -305,15 +305,11 @@
305305 if (!page) {
306306 console.trace(data.query.pages, pageInfo)
307307 return cb(new Error('Unable to find page'))
308308 }
309- var revs = page.revisions
310- if (!revs) {
311- console.trace(page, pageInfo)
312- return cb(new Error('Unable to get revisions'))
313- }
314- console.log('Got ' + page.revisions.length + ' revisions')
315- cb(null, page.revisions)
309 + var revs = page.revisions || []
310 + console.log('Got ' + revs.length + ' revisions')
311 + cb(null, revs)
316312 })
317313 },
318314 pull.flatten(),
319315
@@ -427,8 +423,12 @@
427423 if (dry) {
428424 console.log(JSON.stringify(drafts, 0, 2))
429425 return sbot.close()
430426 }
427 + if (!drafts.length) {
428 + console.log('No messages to publish.')
429 + return sbot.close()
430 + }
431431 if (yes) return confirmed(true)
432432 var rl = readline.createInterface({
433433 input: process.stdin,
434434 output: process.stdout

Built with git-ssb-web