Software /
code /
prosody
Comparison
util/startup.lua @ 8664:d49acc9a8da2
util.startup: Fix chdir() to use correct path variable
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 22 Mar 2018 21:45:38 +0000 |
parent | 8653:dab9b8af0f01 |
child | 8665:4b260a3f8b94 |
comparison
equal
deleted
inserted
replaced
8663:a7a9d9511dc1 | 8664:d49acc9a8da2 |
---|---|
177 if CFG_SOURCEDIR and (prosody.platform == "windows" or CFG_SOURCEDIR:match("^/")) then | 177 if CFG_SOURCEDIR and (prosody.platform == "windows" or CFG_SOURCEDIR:match("^/")) then |
178 prosody.installed = true; | 178 prosody.installed = true; |
179 end | 179 end |
180 end | 180 end |
181 | 181 |
182 function startup.chdir() | |
183 if prosody.installed then | |
184 -- Change working directory to data path. | |
185 require "lfs".chdir(data_path); | |
186 end | |
187 end | |
188 | |
189 function startup.init_global_state() | 182 function startup.init_global_state() |
190 -- luacheck: ignore 121 | 183 -- luacheck: ignore 121 |
191 prosody.bare_sessions = {}; | 184 prosody.bare_sessions = {}; |
192 prosody.full_sessions = {}; | 185 prosody.full_sessions = {}; |
193 prosody.hosts = {}; | 186 prosody.hosts = {}; |
212 prosody.arg = _G.arg; | 205 prosody.arg = _G.arg; |
213 | 206 |
214 startup.detect_platform(); | 207 startup.detect_platform(); |
215 startup.detect_installed(); | 208 startup.detect_installed(); |
216 _G.prosody = prosody; | 209 _G.prosody = prosody; |
210 end | |
211 | |
212 function startup.chdir() | |
213 if prosody.installed then | |
214 -- Change working directory to data path. | |
215 require "lfs".chdir(prosody.paths.data); | |
216 end | |
217 end | 217 end |
218 | 218 |
219 function startup.add_global_prosody_functions() | 219 function startup.add_global_prosody_functions() |
220 -- Function to reload the config file | 220 -- Function to reload the config file |
221 function prosody.reload_config() | 221 function prosody.reload_config() |