d4rkr00t / css-comb-atom

CssComb plugin for atom
9 stars 0 forks source link

No excluding files on save #46

Closed nielsenramon closed 8 years ago

nielsenramon commented 8 years ago

I am trying to exclude a file (normalize.scss) from combing on save but I can't get it to work. I tries absolute paths and relative ones but nothing seems to work.

The .csscomb.json file is in my stylesheets folder and generic/_normalize.scss is in there as well.

In my config I have the following line:

"exclude": ["generic/**"],

Any idea how to fix this?

Thanks!

d4rkr00t commented 8 years ago

Hi, I guess it's happening because plugin provides file content to csscomb instead of file path here https://github.com/d4rkr00t/css-comb-atom/blob/master/src/css-comb.js#L73

I'll take a look at this issue at weekends.

nielsenramon commented 8 years ago

@d4rkr00t Alright thanks man!

d4rkr00t commented 8 years ago

Should work now :)

nielsenramon commented 8 years ago

@d4rkr00t Hmm I can't get it to work on my client. Latest version. Even re-installed your package. Keeps executing in that folder. Anything wrong on my side? How does the package check the path?

d4rkr00t commented 8 years ago

Hi, it checks relative to root directory, where atom is opened.

I'll recheck it again, maybe i messed something up :)

d4rkr00t commented 8 years ago

@nielsenramon Oh, I see from original description that .csscomb.json is in stylesheets folder, so I have to rewrite exclude logic a bit to make it work.

d4rkr00t commented 8 years ago

I think you can write exclude path relative to the root folder and it should work.

"exclude": ["stylesheets/generic/**"],

And I'll fix it in few days :)

nielsenramon commented 8 years ago

@d4rkr00t Indeed I had to use the path relative to the root 👍 Thanks! You could indeed build it so the excluded files are relative to the .csscomb.json file location but it's already awesome I no longer have to disable the plugin just for the exluded files ⭐

d4rkr00t commented 8 years ago

Yep, I'll do it :)

d4rkr00t commented 8 years ago

Second attempt :)

@nielsenramon Can you check it please?

nielsenramon commented 8 years ago

@d4rkr00t Awesome it works great! Thanks for the effort man :)

d4rkr00t commented 8 years ago

Thanks for bug report!