aboutsummaryrefslogtreecommitdiffstats
path: root/tools/migration/prosody-migrator.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-04-05 14:38:08 +0100
committerMatthew Wild <mwild1@gmail.com>2011-04-05 14:38:08 +0100
commitdc08b9834f4d9e00a204fe00b9e547924e0908e5 (patch)
tree59ee455eed836439659c9f0fe7840831cbee4100 /tools/migration/prosody-migrator.lua
parent8c9d841c3d81694d063bd931dbfee0634f53e8f7 (diff)
parentc1e4f6fbdabf5fb3569498877647200daaa6867f (diff)
downloadprosody-dc08b9834f4d9e00a204fe00b9e547924e0908e5.tar.gz
prosody-dc08b9834f4d9e00a204fe00b9e547924e0908e5.zip
Merge 0.8 -> trunk
Diffstat (limited to 'tools/migration/prosody-migrator.lua')
-rw-r--r--tools/migration/prosody-migrator.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/migration/prosody-migrator.lua b/tools/migration/prosody-migrator.lua
index 20631fb1..2a8bf1c3 100644
--- a/tools/migration/prosody-migrator.lua
+++ b/tools/migration/prosody-migrator.lua
@@ -3,6 +3,15 @@
CFG_SOURCEDIR=os.getenv("PROSODY_SRCDIR");
CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR");
+-- Substitute ~ with path to home directory in paths
+if CFG_CONFIGDIR then
+ CFG_CONFIGDIR = CFG_CONFIGDIR:gsub("^~", os.getenv("HOME"));
+end
+
+if CFG_SOURCEDIR then
+ CFG_SOURCEDIR = CFG_SOURCEDIR:gsub("^~", os.getenv("HOME"));
+end
+
local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua";
-- Command-line parsing
@@ -116,9 +125,10 @@ local writer = require("migrator."..otype).writer(config[to_store]);
local json = require "util.json";
+io.stderr:write("Migrating...\n");
for x in reader do
--print(json.encode(x))
writer(x);
end
writer(nil); -- close
-
+io.stderr:write("Done!\n");