diff options
author | Matthew Wild <mwild1@gmail.com> | 2011-04-05 14:11:25 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2011-04-05 14:11:25 +0100 |
commit | 667fc392e957df71290b5b36f86e964ac939fd5e (patch) | |
tree | 1b37d10fc312a2db099b75077383b59783b18400 /tools/migration/prosody-migrator.lua | |
parent | ca74173a8221e9cd93db30c7bb89c8b181f8b60b (diff) | |
download | prosody-667fc392e957df71290b5b36f86e964ac939fd5e.tar.gz prosody-667fc392e957df71290b5b36f86e964ac939fd5e.zip |
tools/migration: Support for ~/ in paths
Diffstat (limited to 'tools/migration/prosody-migrator.lua')
-rw-r--r-- | tools/migration/prosody-migrator.lua | 9 |
1 files changed, 9 insertions, 0 deletions
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 |