express-open-in-editor
express-open-in-editor copied to clipboard
version 1.2.1 doesn't work on windows platform
Looks like this commit broke https://github.com/lahmatiy/express-open-in-editor/commit/25644fbb30957ae8d9e191b9bda40d87daa9390e
@Mavrin Could you fix it? Since I don't use express-open-in-editor currently. The changes was made according to #5
In version 1.2.1
from query string
c:/project/editor/field.jsx:51:13:90:6
after resolve name and apply replace
\project\editor\field.jsx:51:13:90:6
In version 1.2.0
from query string
c:/project/editor/field.jsx:51:13:90:6
after resolve name and apply replace
c:\project\editor\field.jsx:51:13:90:6
I don't know what i should fix. I can't understand why we should cut drive for window platform.
Middleware recieves an absolute path to host, but relative path to cwd. We need keep path relative, but normalize it - that's why path.resolve('/', filename) is using.
But on windows platform path.resolve() adds drive that's not desired behaviour since cwd will be added by opener.