aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-08-04 17:02:59 +0300
committerV1K1NGbg <victor@ilchev.com>2024-08-05 20:51:31 +0300
commit0bc3de49cad9697e101535c1b83c86a55b3731b4 (patch)
tree2848b0026dd4dd03c506e82ca9f06d4b04d0a9f0
parent31a2cb52b0b4dbaa3f5bd17de18aabe40fa37e93 (diff)
downloadluarocks-0bc3de49cad9697e101535c1b83c86a55b3731b4.tar.gz
luarocks-0bc3de49cad9697e101535c1b83c86a55b3731b4.tar.bz2
luarocks-0bc3de49cad9697e101535c1b83c86a55b3731b4.zip
rockspec
-rw-r--r--src/luarocks/type/rockspec.lua15
-rw-r--r--src/luarocks/type/rockspec.tl2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/luarocks/type/rockspec.lua b/src/luarocks/type/rockspec.lua
index d712ba6d..bf43b154 100644
--- a/src/luarocks/type/rockspec.lua
+++ b/src/luarocks/type/rockspec.lua
@@ -10,6 +10,19 @@ local util = require("luarocks.core.util")
10 10
11type_rockspec.rockspec_format = "3.0" 11type_rockspec.rockspec_format = "3.0"
12 12
13
14
15
16
17
18
19
20
21
22
23
24
25
13local rockspec_formats, versions = type_check.declare_schemas({ 26local rockspec_formats, versions = type_check.declare_schemas({
14 ["1.0"] = { 27 ["1.0"] = {
15 fields = { 28 fields = {
@@ -214,7 +227,7 @@ end
214 227
215function type_rockspec.check(rockspec, globals) 228function type_rockspec.check(rockspec, globals)
216 229
217 local version = tostring(rockspec.rockspec_format) or "1.0" 230 local version = rockspec.rockspec_format or "1.0"
218 local ok, err = check_rockspec_using_version(rockspec, globals, version) 231 local ok, err = check_rockspec_using_version(rockspec, globals, version)
219 if ok then 232 if ok then
220 return true 233 return true
diff --git a/src/luarocks/type/rockspec.tl b/src/luarocks/type/rockspec.tl
index fab87fd4..6f431bd9 100644
--- a/src/luarocks/type/rockspec.tl
+++ b/src/luarocks/type/rockspec.tl
@@ -227,7 +227,7 @@ end
227-- succeeded, or nil and an error message if it failed. 227-- succeeded, or nil and an error message if it failed.
228function type_rockspec.check(rockspec: {any: any}, globals: {string: any}): boolean, string 228function type_rockspec.check(rockspec: {any: any}, globals: {string: any}): boolean, string
229 229
230 local version: string = tostring(rockspec.rockspec_format) or "1.0" --! tostring 230 local version: string = rockspec.rockspec_format as string or "1.0" --! tostring
231 local ok, err = check_rockspec_using_version(rockspec, globals, version) 231 local ok, err = check_rockspec_using_version(rockspec, globals, version)
232 if ok then 232 if ok then
233 return true 233 return true