joshua655 / v8cgi

Automatically exported from code.google.com/p/v8cgi
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Config file only accepts absolute paths, not environment variables #104

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be very useful to allow installation in arbitrary locations but this 
is not easy.  The problem is that the config file will only accept a simple 
path in require.paths.push();
Essentially this must be an absolute path.
You cannot use environment variables directly because they are not expanded  
e.g.  require.paths.push("%PROJECTBASE%\v8cgi\lib");
You cannot use them indirectly because the system namespace does not exist yet. 
e.g.
var projectbase = system.env.PROJECTBASE;
require.paths.push(projectbase + "\v8cgi\lib");

In terms of a solution I guess the best one would be to expand environment 
variables in the module resolver since this also addresses the use of variables 
in require() calls.

My current workaround is to generate the config file with the correct absolute 
path during installation.

Andy

Original issue reported on code.google.com by andy.bis...@gmail.com on 23 Nov 2011 at 10:39

GoogleCodeExporter commented 9 years ago
It would be especially useful if one syntax worked for both Windows and Linux.  
I would suggest the ${var} syntax. Of course, %var% should still work in 
Windows and $var in Linux. 

Original comment by andy.bis...@gmail.com on 6 Dec 2011 at 11:21

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/teajs/issues/detail?id=6

Original comment by ondrej.zara on 20 Jul 2012 at 7:50