Skip to content

Commit 5806c22

Browse files
committed
Overwrite the target file instead of printing to stdout.
1 parent ce83675 commit 5806c22

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

util/SQUISH.LUA

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,17 @@ local function Squish(fileName)
134134
data = data .. sep .. token.value
135135
end
136136
end
137-
print(data)
137+
138+
f, e = io.open(fileName, "w")
139+
if not f then
140+
print(e)
141+
return
142+
end
143+
144+
f:write(data)
145+
f:close()
146+
147+
print(fileName .. ":\t" .. beforeSize .. "->" .. #data)
138148
end
139149

140150
if #arg < 1 then

0 commit comments

Comments
 (0)