Comparison

tools/migration/prosody-migrator.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 4235:899ffc1674b5
child 4240:b3d9063aad4d
comparison
equal deleted inserted replaced
4237:6b0d7d94eb7f 4239:69fe5fd861e7
1 #!/usr/bin/env lua 1 #!/usr/bin/env lua
2 2
3 CFG_SOURCEDIR=os.getenv("PROSODY_SRCDIR"); 3 CFG_SOURCEDIR=os.getenv("PROSODY_SRCDIR");
4 CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR"); 4 CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR");
5
6 -- Substitute ~ with path to home directory in paths
7 if CFG_CONFIGDIR then
8 CFG_CONFIGDIR = CFG_CONFIGDIR:gsub("^~", os.getenv("HOME"));
9 end
10
11 if CFG_SOURCEDIR then
12 CFG_SOURCEDIR = CFG_SOURCEDIR:gsub("^~", os.getenv("HOME"));
13 end
5 14
6 local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua"; 15 local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua";
7 16
8 -- Command-line parsing 17 -- Command-line parsing
9 local options = {}; 18 local options = {};