montagejs / mop

Montage Optimizer (mop): Minifies (to reduce file size) and creates bundles (to reduce the number of requests) of Montage applications.
Other
31 stars 15 forks source link

Windows Support #47

Open kriskowal opened 10 years ago

kriskowal commented 10 years ago

Mop was designed to work on Windows, but it was never tested and I cut some corners, especially in Mr where paths are supposed to be consistently normalized to URL’s, and where URL’s have to be transformed back to paths for FS operations.

kriskowal commented 10 years ago

@stuk left some notes https://gist.github.com/anonymous/f9f7e996dd74c525d1b0

onezeroonezero commented 10 years ago

Hi guys, Still having issues after editing optimize.js in ...\AppData\Roaming\npm\node_modules\mop\ as per path.diff (https://gist.github.com/anonymous/f9f7e996dd74c525d1b0)

Error: Can't read /Program%20Files/.../temp-converter/package.json because ENOENT, open 'C:\Program%20Files\...\temp-converter\package.json'

The command to open seems to have the right path but for some reason at execution, the path gets transformed into a unix format which obviously can't be used to access the file in Windows.

Please advise where the path transformation occurs so that I can apply fixes such as is in path.diff (https://gist.github.com/anonymous/f9f7e996dd74c525d1b0) to the applicable file(s).

onezeroonezero commented 10 years ago

Sorry about the massive font -- not sure how/why my comment was posted as such

Stuk commented 10 years ago

I was taking another look at this yesterday, and will hopefully fix it today.

(Markdown was treating the ----s as an underline for a title, hence the giant font :). I've edited your comment to put it inside a code block)

Stuk commented 10 years ago

I have a PR here for review: https://github.com/montagejs/mop/pull/50

onezeroonezero commented 10 years ago

Thanks @Stuk. Much appreciated. Will check out the PR

onezeroonezero commented 10 years ago

Turns out problem was due to space character in directory absolute path name - Program Files - mop works just fine when run from a directory with no space in its path name Thanks for the effort guys

kriskowal commented 10 years ago

Oh, that’s interesting, and probably reproducible elsewhere.

oliverrahner commented 9 years ago

Just stumbled over @onezeroonezero's issue with a path containing spaces on Windows... The issue seems to be that the path is URL encoded somewhere along the way, as can be seen in @onezeroonezero's first post: Can't read /Program%20Files/