From 30edba39b9c074ad0f2957af2f51e2ed7e537c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 8 Apr 2019 17:09:12 +0200 Subject: [PATCH] =?UTF-8?q?Convert=20L=C3=96VE=20version=20to=20version=20?= =?UTF-8?q?object,=20fix=20#55?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pipes/args.lua | 3 ++- src/utils.lua | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pipes/args.lua b/src/pipes/args.lua index e153fa3..53160e2 100644 --- a/src/pipes/args.lua +++ b/src/pipes/args.lua @@ -72,8 +72,9 @@ function Args:__call(project) if args.desc then project:setDescription(args.desc) end if args.email then project:setEmail(args.email) end if args.loveVersion then + args.loveVersion = utils.love.ver(args.loveVersion) assert(utils.love.isSupported(args.loveVersion), - "ARGS: "..args.loveVersion.." is not supported.\n") + "ARGS: "..tostring(args.loveVersion).." is not supported.\n") project:setLoveVersion(args.loveVersion) end if args.package then project:setPackage(args.package) end diff --git a/src/utils.lua b/src/utils.lua index 845d729..775809c 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -95,6 +95,7 @@ utils.love.minVersion = utils.love.versionTable[#utils.love.versionTable] -- @tparam ver version LÖVE version. -- @treturn bool true is the version is supported. function utils.love.isSupported(version) + assert(getmetatable(version) == ver) if version >= utils.love.minVersion and version <= utils.love.lastVersion then for _, v in ipairs(utils.love.versionTable) do