1
0
mirror of https://github.com/natnat-mc/moonbuild synced 2026-05-28 09:39:40 +02:00

4 Commits

Author SHA1 Message Date
Nathan DECHER 0779ea3ad4 Producing rockspec 1.1.3-1 2020-09-15 11:37:21 +02:00
Nathan DECHER e3e185110a Merge branch 'master' of github.com:natnat-mc/moonbuild 2020-09-15 11:37:04 +02:00
Nathan DECHER 7b4973f0b4 fixed wildcard and normalizepath 2020-09-15 11:36:44 +02:00
Nathan DECHER c96b2ece70 fixed wildcard and normalizepath 2020-09-15 11:36:17 +02:00
3 changed files with 34 additions and 4 deletions
+6 -2
View File
@@ -120,7 +120,11 @@ normalizepath = function(file)
break break
end end
end end
return (absolute and '/' or '') .. concat(parts, '/') if #parts == 0 then
return '.'
else
return (absolute and '/' or '') .. concat(parts, '/')
end
end end
local ls local ls
ls = function(d) ls = function(d)
@@ -201,7 +205,7 @@ wildcard = function(glob)
local absolute = (sub(glob, 1, 1)) == '/' local absolute = (sub(glob, 1, 1)) == '/'
for i, part in ipairs(parts) do for i, part in ipairs(parts) do
local prevpath = (absolute and '/' or '') .. concat(parts, '/', 1, i - 1) local prevpath = (absolute and '/' or '') .. concat(parts, '/', 1, i - 1)
local currpath = prevpath .. '/' .. part local currpath = (i == 1 and '' or (prevpath .. '/')) .. part
if match(part, '%*%*.*%*%*') then if match(part, '%*%*.*%*%*') then
error("Two '**' in the same path component in a wildcard") error("Two '**' in the same path component in a wildcard")
end end
+5 -2
View File
@@ -16,7 +16,10 @@ normalizepath = (file) ->
remove parts, i-1 remove parts, i-1
i -= 2 i -= 2
continue continue
(absolute and '/' or '') .. concat parts, '/' if #parts==0
'.'
else
(absolute and '/' or '') .. concat parts, '/'
ls = (d) -> ls = (d) ->
[f for f in *dir normalizepath d when f!='.' and f!='..'] [f for f in *dir normalizepath d when f!='.' and f!='..']
@@ -54,7 +57,7 @@ wildcard = (glob) ->
for i, part in ipairs parts for i, part in ipairs parts
prevpath = (absolute and '/' or '') .. concat parts, '/', 1, i-1 prevpath = (absolute and '/' or '') .. concat parts, '/', 1, i-1
currpath = prevpath .. '/' .. part currpath = (i==1 and '' or (prevpath .. '/')) .. part
if match part, '%*%*.*%*%*' if match part, '%*%*.*%*%*'
error "Two '**' in the same path component in a wildcard" error "Two '**' in the same path component in a wildcard"
+23
View File
@@ -0,0 +1,23 @@
build = {
install = {
bin = {
moonbuild = "moonbuild.lua"
}
},
type = "builtin"
}
dependencies = {
"lua >= 5.3",
"luafilesystem >= 1.7.0"
}
description = {
detailed = "moonbuild is a small build system that simplifies your build definitions by allowing you to use declarative as well as imperative rules. It represents the build as a DAG with explicit ordering, and doesn't give you any default confusing rules (unlike make)\n",
summary = "Small build system in between make and a build.sh"
}
package = "moonbuild"
rockspec_format = "3.0"
source = {
tag = "v1.1.3",
url = "git://github.com/natnat-mc/moonbuild"
}
version = "1.1.3-1"