Diff

tools/migration/migrator/prosody_files.lua @ 4239:69fe5fd861e7

tools/migration: Support for ~/ in paths
author Matthew Wild <mwild1@gmail.com>
date Tue, 05 Apr 2011 14:11:25 +0100
parent 4216:ff80a8471e86
child 4241:49b9e73e31ef
line wrap: on
line diff
--- a/tools/migration/migrator/prosody_files.lua	Tue Apr 05 13:26:19 2011 +0100
+++ b/tools/migration/migrator/prosody_files.lua	Tue Apr 05 14:11:25 2011 +0100
@@ -22,7 +22,7 @@
 local function is_dir(path) return lfs.attributes(path, "mode") == "directory"; end
 local function is_file(path) return lfs.attributes(path, "mode") == "file"; end
 local function clean_path(path)
-	return path:gsub("\\", "/"):gsub("//+", "/");
+	return path:gsub("\\", "/"):gsub("//+", "/"):gsub("^~", os.getenv("HOME") or "~");
 end
 local encode, decode; do
 	local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end });