express-open-in-editor icon indicating copy to clipboard operation
express-open-in-editor copied to clipboard

version 1.2.1 doesn't work on windows platform

Open Mavrin opened this issue 9 years ago • 3 comments

image Looks like this commit broke https://github.com/lahmatiy/express-open-in-editor/commit/25644fbb30957ae8d9e191b9bda40d87daa9390e

Mavrin avatar Sep 15 '16 11:09 Mavrin

@Mavrin Could you fix it? Since I don't use express-open-in-editor currently. The changes was made according to #5

lahmatiy avatar Sep 15 '16 15:09 lahmatiy

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.

Mavrin avatar Sep 17 '16 15:09 Mavrin

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.

lahmatiy avatar Sep 20 '16 15:09 lahmatiy