1 | // turns out tagging isn't very complicated
|
2 | // all the smarts are in the couch.
|
3 | module.exports = tag
|
4 | tag.usage = "npm tag <project>@<version> [<tag>]"
|
5 |
|
6 | tag.completion = require("./unpublish.js").completion
|
7 |
|
8 | var npm = require("./npm.js")
|
9 | , registry = npm.registry
|
10 |
|
11 | function tag (args, cb) {
|
12 | var thing = (args.shift() || "").split("@")
|
13 | , project = thing.shift()
|
14 | , version = thing.join("@")
|
15 | , t = args.shift() || npm.config.get("tag")
|
16 | if (!project || !version || !t) return cb("Usage:\n"+tag.usage)
|
17 | registry.tag(project, version, t, cb)
|
18 | }
|