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
|
||||
|
||||
out_f:write(code.."\n")
|
||||
out_f:close()
|
||||
|
||||
return true
|
||||
end
|
||||
@ -197,7 +198,9 @@ if opts.w then
|
||||
if events then
|
||||
for _, ev in ipairs(events) do
|
||||
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
|
||||
print()
|
||||
@ -208,6 +211,7 @@ if opts.w then
|
||||
print("Built", fname)
|
||||
end
|
||||
end
|
||||
end
|
||||
else break end
|
||||
end
|
||||
else
|
||||
@ -216,6 +220,8 @@ else
|
||||
if not success then
|
||||
print(fname, err)
|
||||
break
|
||||
else
|
||||
print("Built", fname)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user