kungfusheep / SublimeLinter-contrib-stylelint

this repo is no longer maintained - please see https://github.com/SublimeLinter/SublimeLinter-stylelint
MIT License
116 stars 19 forks source link

fix(stylelint_wrapper): fix cli.js path on Windows #32

Closed neojp closed 8 years ago

neojp commented 8 years ago

Windows' directory separators are backslashes like this \, trying to replace /node_modules would end up with 2 node_module directories in the same path failing the conditional.

The original code returned the following path:

C:\Users\neojp\AppData\Roaming\npm\node_modules/node_modules/stylelint/dist/cli.js

Proposed code returns the following:

C:\Users\neojp\AppData\Roaming\npm\node_modules/stylelint/dist/cli.js

By failing the conditional if(cliLocation){ it would attempt to run the else section returning the following error:

Error: Cannot find module 'postcss'

This fix only applies to global packages.

neojp commented 8 years ago

:shipit: :+1: