Commit bd722e72406db3a793dbeada2e62de0bbaa26c22
Add missing name command
Charles Lehner committed on 8/28/2016, 3:14:12 AMParent: 48bff19f3285b04fb6b35dbcbb263793e79738ae
Files changed
bin.js | changed |
bin.js | ||
---|---|---|
@@ -197,4 +197,24 @@ | ||
197 | 197 … | if (!name) err(1, 'missing remote name') |
198 | 198 … | |
199 | 199 … | createRepo(argv, name, repo) |
200 | 200 … | } |
201 … | + | |
202 … | +function nameRepo(argv) { | |
203 … | + var repo | |
204 … | + if (argv._.length == 1) repo = u.getDefaultRemote() | |
205 … | + else if (argv._.length == 2) repo = u.getRemote(argv._.shift()) | |
206 … | + else return help('name') | |
207 … | + if (!repo) err(1, 'unable to find git-ssb repo') | |
208 … | + var name = argv._[0] | |
209 … | + if (!name) err(1, 'missing name') | |
210 … | + | |
211 … | + u.getSbot(argv, function (err, sbot) { | |
212 … | + if (err) throw err | |
213 … | + var schemas = require('ssb-msg-schemas') | |
214 … | + sbot.publish(schemas.name(repo, name), function (err, msg) { | |
215 … | + if (err) throw err | |
216 … | + console.log(msg.key) | |
217 … | + sbot.close() | |
218 … | + }) | |
219 … | + }) | |
220 … | +} |
Built with git-ssb-web