aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/new_version.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/luarocks/new_version.lua b/src/luarocks/new_version.lua
index 6969d4b2..3382b85c 100644
--- a/src/luarocks/new_version.lua
+++ b/src/luarocks/new_version.lua
@@ -11,13 +11,14 @@ local fs = require("luarocks.fs")
11local type_check = require("luarocks.type_check") 11local type_check = require("luarocks.type_check")
12 12
13new_version.help_summary = "Auto-write a rockspec for a new version of a rock." 13new_version.help_summary = "Auto-write a rockspec for a new version of a rock."
14new_version.help_arguments = "[--tag=<tag>] {<package>|<rockspec>} [<new_version>] [<new_url>]" 14new_version.help_arguments = "[--tag=<tag>] [<package>|<rockspec>] [<new_version>] [<new_url>]"
15new_version.help = [[ 15new_version.help = [[
16This is a utility function that writes a new rockspec, updating data 16This is a utility function that writes a new rockspec, updating data
17from a previous one. 17from a previous one.
18 18
19If a package name is given, it downloads the latest rockspec from the 19If a package name is given, it downloads the latest rockspec from the
20default server. If a rockspec is given, it uses it instead. 20default server. If a rockspec is given, it uses it instead. If no argument
21is given, it looks for a rockspec same way 'luarocks make' does.
21 22
22If the version number is not given and tag is passed using --tag, 23If the version number is not given and tag is passed using --tag,
23it is used as the version, with 'v' removed from beginning. 24it is used as the version, with 'v' removed from beginning.
@@ -125,12 +126,16 @@ end
125function new_version.run(...) 126function new_version.run(...)
126 local flags, input, version, url = util.parse_flags(...) 127 local flags, input, version, url = util.parse_flags(...)
127 if not input then 128 if not input then
128 return nil, "Missing argument: expected package or rockspec. "..util.see_help("new_version") 129 local err
130 input, err = util.get_default_rockspec()
131 if not input then
132 return nil, err
133 end
129 end 134 end
130 assert(type(input) == "string") 135 assert(type(input) == "string")
131 136
132 local filename = input 137 local filename = input
133 if not input:match(".rockspec$") then 138 if not input:match("rockspec$") then
134 local err 139 local err
135 filename, err = download.download("rockspec", input) 140 filename, err = download.download("rockspec", input)
136 if not filename then 141 if not filename then