38 -- require "util.logger".setwriter(function () end); |
38 -- require "util.logger".setwriter(function () end); |
39 |
39 |
40 do |
40 do |
41 -- TODO: Check for other formats when we add support for them |
41 -- TODO: Check for other formats when we add support for them |
42 -- Use lfs? Make a new conf/ dir? |
42 -- Use lfs? Make a new conf/ dir? |
43 local ok, err = config.load((CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); |
43 local ok, level, err = config.load((CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); |
44 if not ok then |
44 if not ok then |
45 print(""); |
45 print(""); |
46 print("**************************"); |
46 print("**************************"); |
47 print("Prosody was unable to find the configuration file."); |
47 if level == "parser" then |
48 print("We looked for: "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); |
48 print("A problem occured while reading the config file "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); |
49 print("A sample config file is included in the Prosody download called prosody.cfg.lua.dist"); |
49 local err_line, err_message = tostring(err):match("%[string .-%]:(%d*): (.*)"); |
50 print("Copy or rename it to prosody.cfg.lua and edit as necessary."); |
50 print("Error"..(err_line and (" on line "..err_line) or "")..": "..(err_message or tostring(err))); |
|
51 print(""); |
|
52 elseif level == "file" then |
|
53 print("Prosody was unable to find the configuration file."); |
|
54 print("We looked for: "..(CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); |
|
55 print("A sample config file is included in the Prosody download called prosody.cfg.lua.dist"); |
|
56 print("Copy or rename it to prosody.cfg.lua and edit as necessary."); |
|
57 end |
51 print("More help on configuring Prosody can be found at http://prosody.im/doc/configure"); |
58 print("More help on configuring Prosody can be found at http://prosody.im/doc/configure"); |
52 print("Good luck!"); |
59 print("Good luck!"); |
53 print("**************************"); |
60 print("**************************"); |
|
61 print(""); |
54 os.exit(1); |
62 os.exit(1); |
55 end |
63 end |
56 end |
64 end |
57 |
65 |
58 require "util.dependencies" |
66 require "util.dependencies" |