electrode-io / electrode-confippet

node.js environment aware application configuration
Other
108 stars 18 forks source link

Windows support? #13

Open wmertens opened 7 years ago

wmertens commented 7 years ago

Sorry, not a windows user myself, but I know that you're supposed to use path.join or path.resolve to get valid paths on both Unix and Windows.

I'm thinking that maybe confippet could have a default function root which takes the remaining refs, resolves them, splits them on /, and then uses path.resolve(config.root || process.cwd, ...refs) to generate a valid path on all platforms? So you could e.g. specify paths as icons: '{{root:config.assets:-icons}}'?

I suppose some way to escape : and / in refs would also be necessary.

jchip commented 7 years ago

I think if dealing with paths correctly on Unix and windows is required, confippet could just use path.normalize for anything that's meant to be a path, and internally keep everything as Unix paths.