local opts, arguments = e2option.parse(arg)
-- get build mode from the command line
- local build_mode = policy.handle_commandline_options(opts, true)
+ local build_mode, re = policy.handle_commandline_options(opts, true)
if not build_mode then
- return false, err.new("no build mode given")
+ return false, re
end
info, re = e2tool.collect_project_info(info)
local opts, arguments = e2option.parse(arg)
-- get build mode from the command line
- local build_mode = policy.handle_commandline_options(opts, true)
+ local build_mode, re = policy.handle_commandline_options(opts, true)
if not build_mode then
- return false, err.new("no build mode given")
+ return false, re
end
info, re = e2tool.collect_project_info(info)
if not info then
function policy.handle_commandline_options(opts, use_default)
local default_build_mode_name = "tag"
local nmodes = 0
- local mode = nil
+ local mode = false
+
if opts["build-mode"] then
nmodes = nmodes + 1
end
nmodes = nmodes + 1
end
if nmodes > 1 then
- e2lib.abort("Error: Multiple build modes are not supported")
+ return false, err.new("multiple build modes are not supported")
end
if not opts["build-mode"] and use_default then
e2lib.warnf("WDEFAULT", "build-mode defaults to '%s'",
default_build_mode_name)
opts["build-mode"] = default_build_mode_name
end
+
if opts["build-mode"] then
if policy.default_build_mode(opts["build-mode"]) then
mode = policy.default_build_mode(opts["build-mode"])
else
- e2lib.abort("invalid build mode")
+ return false, err.new("invalid build mode")
end
if opts["build-mode"] == "release" then
opts["check-remote"] = true
opts["check"] = true
end
end
+
+ if not mode then
+ return false, err.new("no build mode given")
+ end
+
return mode
end
deploy = false,
}
else
- -- e2lib.abort("unknown default_build_mode mode=%s", tostring(mode))
return nil
end
end