Files: 28bf61d928af584e5e33b424fc41deafa9dddb77 / lib / create-id.js
1106 bytesRaw
1 | var u = require('./util') |
2 | |
3 | exports.help = ` |
4 | Usage: git ssb create-id [--name <name> | --no-name] [<options>] |
5 | |
6 | Create a new git-ssb repo and output its URL. |
7 | |
8 | Options: |
9 | --upstream <id> id, url, or remote name of repo to create a fork of |
10 | --name <name> Name to give the repo. Required unless '--no-name' is given |
11 | --no-name Don't name the repo |
12 | --private Make repo private |
13 | --recps <feed>,... List of recipients for a private repo. Implies --private |
14 | ` |
15 | |
16 | exports.fn = function (argv) { |
17 | if (argv._.length > 0 || argv.name == null) return u.help('create-id') |
18 | |
19 | u.getSbot(argv, function (err, sbot) { |
20 | if (err) throw err |
21 | var upstream = argv.upstream && u.getRemote(argv.upstream) |
22 | u.getRecps(sbot, argv, function (err, recps) { |
23 | if (err) throw err |
24 | require('ssb-git-repo').createRepo(sbot, { |
25 | upstream: upstream, |
26 | name: argv.name, |
27 | recps: recps, |
28 | }, function (err, repo) { |
29 | if (err) throw err |
30 | var url = 'ssb://' + repo.id |
31 | console.log(url) |
32 | repo.close() |
33 | sbot.close() |
34 | }) |
35 | }) |
36 | }) |
37 | } |
38 |
Built with git-ssb-web