diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-03-20 14:05:00 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-03-20 14:05:36 -0300 |
| commit | 86c7e28a811a95d542c9453c363574d17d648dc5 (patch) | |
| tree | f5d592e0930c5ca172cd130621b02f551a9919d8 /src | |
| parent | 435e0f3a27ec3df244881ba0c9b1989de913b41f (diff) | |
| download | luarocks-86c7e28a811a95d542c9453c363574d17d648dc5.tar.gz luarocks-86c7e28a811a95d542c9453c363574d17d648dc5.tar.bz2 luarocks-86c7e28a811a95d542c9453c363574d17d648dc5.zip | |
upload: new flag --temp-key
New flag `--temp-key` for `luarocks upload`, allowing you to easily
upload rocks into an alternate account without disrupting the
stored configuration of your main account.
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/cmd/upload.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/upload/api.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/util.lua | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/luarocks/cmd/upload.lua b/src/luarocks/cmd/upload.lua index a0b69447..ffcb1a0a 100644 --- a/src/luarocks/cmd/upload.lua +++ b/src/luarocks/cmd/upload.lua | |||
| @@ -14,6 +14,8 @@ upload.help = [[ | |||
| 14 | upload rockspec and source rock to server. | 14 | upload rockspec and source rock to server. |
| 15 | --skip-pack Do not pack and send source rock. | 15 | --skip-pack Do not pack and send source rock. |
| 16 | --api-key=<key> Give it an API key. It will be stored for subsequent uses. | 16 | --api-key=<key> Give it an API key. It will be stored for subsequent uses. |
| 17 | --temp-key=<key> Use the given a temporary API key in this invocation only. | ||
| 18 | It will not be stored. | ||
| 17 | --force Replace existing rockspec if the same revision of | 19 | --force Replace existing rockspec if the same revision of |
| 18 | a module already exists. This should be used only | 20 | a module already exists. This should be used only |
| 19 | in case of upload mistakes: when updating a rockspec, | 21 | in case of upload mistakes: when updating a rockspec, |
diff --git a/src/luarocks/upload/api.lua b/src/luarocks/upload/api.lua index ff00850e..a9afd1af 100644 --- a/src/luarocks/upload/api.lua +++ b/src/luarocks/upload/api.lua | |||
| @@ -272,7 +272,7 @@ function api.new(flags) | |||
| 272 | self.config = self:load_config() or {} | 272 | self.config = self:load_config() or {} |
| 273 | self.config.server = flags["server"] or self.config.server or cfg.upload.server | 273 | self.config.server = flags["server"] or self.config.server or cfg.upload.server |
| 274 | self.config.version = self.config.version or cfg.upload.version | 274 | self.config.version = self.config.version or cfg.upload.version |
| 275 | self.config.key = flags["api-key"] or self.config.key | 275 | self.config.key = flags["temp-key"] or flags["api-key"] or self.config.key |
| 276 | self.debug = flags["debug"] | 276 | self.debug = flags["debug"] |
| 277 | if not self.config.key then | 277 | if not self.config.key then |
| 278 | return nil, "You need an API key to upload rocks.\n" .. | 278 | return nil, "You need an API key to upload rocks.\n" .. |
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 1bc24be7..bc8fc049 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua | |||
| @@ -137,6 +137,7 @@ local supported_flags = { | |||
| 137 | ["summary"] = "\"<text>\"", | 137 | ["summary"] = "\"<text>\"", |
| 138 | ["system-config"] = true, | 138 | ["system-config"] = true, |
| 139 | ["tag"] = "<tag>", | 139 | ["tag"] = "<tag>", |
| 140 | ["temp-key"] = "<key>", | ||
| 140 | ["timeout"] = "<seconds>", | 141 | ["timeout"] = "<seconds>", |
| 141 | ["to"] = "<path>", | 142 | ["to"] = "<path>", |
| 142 | ["tree"] = "<path>", | 143 | ["tree"] = "<path>", |
