Issue #8
Fixed configuration file parsing: byLine requires that the file be opened in text mode to properly handle CRLF line endings. Added build batch file.
This commit is contained in:
parent
204ab386eb
commit
8cc0f2546d
|
@ -0,0 +1,2 @@
|
|||
dmd -wi client.d messages.d msgpack-d/src/msgpack.d -Imsgpack-d/src -ofdcd-client -L/exet:nt/su:windows:4.0
|
||||
dmd -wi -g server.d modulecache.d actypes.d messages.d constants.d acvisitor.d autocomplete.d dscanner/stdx/d/ast.d dscanner/stdx/d/parser.d dscanner/stdx/d/lexer.d dscanner/stdx/d/entities.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner/ -ofdcd-server
|
25
server.d
25
server.d
|
@ -143,19 +143,20 @@ int main(string[] args)
|
|||
|
||||
string[] loadConfiguredImportDirs()
|
||||
{
|
||||
version(Windows)
|
||||
{
|
||||
string fullPath = buildPath(getcwd(), CONFIG_FILE_PATH);
|
||||
}
|
||||
else version(Posix)
|
||||
{
|
||||
string fullPath = expandTilde(CONFIG_FILE_PATH);
|
||||
}
|
||||
version(Windows)
|
||||
{
|
||||
string fullPath = buildPath(getcwd(), CONFIG_FILE_PATH);
|
||||
}
|
||||
else version(Posix)
|
||||
{
|
||||
string fullPath = expandTilde(CONFIG_FILE_PATH);
|
||||
}
|
||||
|
||||
if (!exists(fullPath))
|
||||
return [];
|
||||
File f = File(fullPath);
|
||||
return f.byLine(KeepTerminator.no).map!(a => a.idup).filter!(a => a.exists()).array();
|
||||
if (!exists(fullPath))
|
||||
return [];
|
||||
|
||||
File f = File(fullPath, "rt");
|
||||
return f.byLine(KeepTerminator.no).map!(a => a.idup).filter!(a => a.exists()).array();
|
||||
}
|
||||
|
||||
void printHelp(string programName)
|
||||
|
|
Loading…
Reference in New Issue