mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
fixed loop bug
This commit is contained in:
parent
233738aad2
commit
3ebfe88d30
8
moonc
8
moonc
@ -70,6 +70,7 @@ function compile_file(from, to)
|
|||||||
end
|
end
|
||||||
|
|
||||||
out_f:write(code.."\n")
|
out_f:write(code.."\n")
|
||||||
|
out_f:close()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -197,7 +198,9 @@ if opts.w then
|
|||||||
if events then
|
if events then
|
||||||
for _, ev in ipairs(events) do
|
for _, ev in ipairs(events) do
|
||||||
local fname = wd_table[ev.wd]..ev.name
|
local fname = wd_table[ev.wd]..ev.name
|
||||||
local success, err = compile_file(fname, target_dir..convert_path(fname))
|
if fname:match("%.moon$") then
|
||||||
|
local target = target_dir..convert_path(fname)
|
||||||
|
local success, err = compile_file(fname, target)
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
print()
|
print()
|
||||||
@ -208,6 +211,7 @@ if opts.w then
|
|||||||
print("Built", fname)
|
print("Built", fname)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
else break end
|
else break end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -216,6 +220,8 @@ else
|
|||||||
if not success then
|
if not success then
|
||||||
print(fname, err)
|
print(fname, err)
|
||||||
break
|
break
|
||||||
|
else
|
||||||
|
print("Built", fname)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user