Commit Graph

4 Commits

Author SHA1 Message Date
Emil Hessman d5a49363d7 config/module: handle absolute file paths on Windows
Using url.Parse to parse an absolute file path on Windows yields
a URL type where the Path element is prefixed by a slash.

For example, parsing "file:///C:/Users/user" gives a URL type
with Path:"/C:/Users/user".

According to golang.org/issue/6027, the parsing is correct as is.

The leading slash on the Path must be eliminated before any file
operations.

This commit introduces a urlParse function which wraps the url.Parse
functionality and removes the leading slash in Path for absolute file
paths on Windows.

Fixes config/module test failures on Windows.
2015-01-27 23:18:47 +01:00
Emil Hessman 74cf8fcabd config/module: adjust FileDetector tests for Windows
"/foo" is not an absolute path on Windows. Adjust the FileDetector
tests to take that into account when verifying the results.

Fixes FileDetector test failures on Windows.
2015-01-27 23:18:46 +01:00
Mitchell Hashimoto 6eee9fbcb3 config/module: file paths require pwd 2014-09-14 19:28:18 -07:00
Mitchell Hashimoto a35a9262d4 config/module: detectors, some more work on Tree 2014-09-14 16:17:29 -07:00