Skip to content

Commit 9349bd5

Browse files
authored
Merge pull request #141 from mpeterv/fix-cli-globals
fix(cli): Fix some globals in sailor.cli
2 parents d0df7c8 + 78cae0d commit 9349bd5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

sailor

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
-- http://sailorproject.org
99
--------------------------------------------------------------------------------
1010

11-
local lfs = require "lfs"
1211
local argparse = require "argparse"
1312
local colors = require "ansicolors"
1413
local actions = require "sailor.cli"

src/sailor/cli.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
-- http://sailorproject.org
77
--------------------------------------------------------------------------------
88

9+
local lfs = require "lfs"
10+
911
local cli = {}
1012

1113
local function get_sailor_path(current_dir)
@@ -117,18 +119,18 @@ function cli.start()
117119
end
118120

119121
function cli.test(args, _)
120-
local ok, code
122+
local ok
121123

122-
flags = table.concat(args.EXTRA_FLAGS, " ")
124+
local flags = table.concat(args.EXTRA_FLAGS, " ")
123125

124126
if args.resty then
125-
ok, code = os.execute('resty tests/bootstrap_resty.lua')
127+
ok = os.execute('resty tests/bootstrap_resty.lua')
126128
else
127-
ok, code = os.execute('busted --helper=tests/bootstrap.lua '..flags..' tests/unit/* tests/functional/*')
129+
ok = os.execute('busted --helper=tests/bootstrap.lua '..flags..' tests/unit/* tests/functional/*')
128130
end
129131

130132
if type(ok) == "number" then return ok end -- Lua 5.1 just returns the status code
131-
exit_code = ok and 0 or 1 -- don't care about actual value
133+
local exit_code = ok and 0 or 1 -- don't care about actual value
132134

133135
if exit_code and exit_code ~= 0 then
134136
-- exit code sometimes is > 255 and fails to be propagated

0 commit comments

Comments
 (0)