Skip to content

Commit

Permalink
addressing review
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco committed Jul 18, 2017
1 parent 8bab7f8 commit 8312eb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions kong/cmd/prepare.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,25 @@ local function execute(args)
local ok, err = prefix_handler.prepare_prefix(conf, args.nginx_conf)
if not ok then
log.verbose("could not prepare Kong")
error(err) -- report to main error handler
error("could not prepare Kong prefix at " .. conf.prefix .. ": " .. err)
end
end

local lapp = [[
Usage: kong prepare [OPTIONS]
Prepares the Kong prefix in the configured prefix directory.
Prepare the Kong prefix in the configured prefix directory. This command can
be used to start Kong from the nginx binary without using the 'kong start'
command.
Example usage:
kong prepare -p /usr/local/kong -c kong.conf && kong migrations up &&
nginx -p /usr/local/kong -c /usr/local/kong/nginx.conf
Options:
-c,--conf (optional string) configuration file
-p,--prefix (optional string) override prefix directory
--nginx-conf (optional string) custom Nginx configuration template
]]

return {
Expand Down
2 changes: 1 addition & 1 deletion spec/02-integration/02-cmd/10-prepare_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("kong prepare", function()
end)

it("prepares prefix with default conf/prefix", function()
assert(helpers.kong_exec "prepare")
assert(helpers.kong_exec("prepare -p " .. helpers.test_conf.prefix))
end)

describe("errors", function()
Expand Down

0 comments on commit 8312eb7

Please sign in to comment.