From 667fc392e957df71290b5b36f86e964ac939fd5e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 5 Apr 2011 14:11:25 +0100 Subject: tools/migration: Support for ~/ in paths --- tools/migration/prosody-migrator.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools/migration/prosody-migrator.lua') diff --git a/tools/migration/prosody-migrator.lua b/tools/migration/prosody-migrator.lua index 20631fb1..feebe484 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 -- cgit v1.2.3