config and data directories taken from path, and quoted to allow spaces in path

Wed, 03 Dec 2008 19:57:08 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Wed, 03 Dec 2008 19:57:08 +0500
changeset 523
c0f15538f358
parent 522
fc3df507afa2
child 524
3f9f67f1a106

config and data directories taken from path, and quoted to allow spaces in path

prosody file | annotate | diff | comparison | revisions
--- a/prosody	Wed Dec 03 19:56:05 2008 +0500
+++ b/prosody	Wed Dec 03 19:57:08 2008 +0500
@@ -3,9 +3,9 @@
 -- Config here --
 
 CFG_SOURCEDIR=nil;
-CFG_CONFIGDIR=nil;
+CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR");
 CFG_PLUGINDIR=nil;
-CFG_DATADIR=nil;
+CFG_DATADIR=os.getenv("PROSODY_DATADIR");
 
 -- -- -- -- -- --
 
@@ -54,7 +54,7 @@
 function mkdir(path)
 	path = path:gsub("/", path_separator);
 	--print("mkdir",path);
-	local x = io.popen("mkdir "..path.." 2>&1"):read("*a");
+	local x = io.popen("mkdir \""..path.."\" 2>&1"):read("*a");
 end
 function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end
 function mkdirs(host)

mercurial