Skip to content

Commit

Permalink
#48 rename function to match lua expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasJurczok committed Oct 6, 2018
1 parent 0edf516 commit 73a14a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

globals = {"faketorio", "busted", "feature", "scenario", "before_scenario",
"after_scenario", "commands", "game", "defines", "script", "when",
"unpack", "os"}
"unpack"}
read_globals = {
os = {
fields = {
Expand Down
4 changes: 2 additions & 2 deletions src/faketorio/package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function faketorio.package()
-- ULTRA HACK because installing zlib on windows is a huuuuge pain
-- we ship our own 7z.exe and .dll and use luarocks to find our installation dir.
if (cfg.arch:find("win32")) then
local zip = os.capture("luarocks show faketorio --rock-dir").."/tools/7z.exe"
local zip = faketorio.capture_command_output("luarocks show faketorio --rock-dir").."/tools/7z.exe"
local command = zip .. " a " .. faketorio.output_name ..".zip " .. faketorio.output_name
os.execute(command)
else
Expand All @@ -22,7 +22,7 @@ function faketorio.package()
end

-- courtesy of https://stackoverflow.com/questions/132397/get-back-the-output-of-os-execute-in-lua
function os.capture(cmd, raw)
function faketorio.capture_command_output(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
Expand Down

0 comments on commit 73a14a6

Please sign in to comment.