-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to specify multiple files in cli? #223
Comments
./node_modules/.bin/stylefmt --help
Usage: stylefmt [options] input-name [output-name]
Options:
-d, --diff output diff against original file
-l, --list format list of space seperated files in place
-R, --recursive format files recursively
-c, --config path to a specific configuration file (JSON, YAML, or CommonJS)
-b, --config-basedir path to the directory that relative paths defining "extends"
-v, --version output the version number
-h, --help output usage information
|
hi @gucong3000 i do not have a separeted list of files, is it possible to send in a glob ./node_modules/.bin/stylefmt -d -R ./src/**/*.css |
LGM, I will push a PR to support glob |
Awesome! |
Already support glob in #232 @noahehall , you can have a try. npm i -g gucong3000/stylefmt#glob_support
stylefmt -d -l test/sass/**/*.css "!**/*.out.css" |
just a note - if no .css files are found it throws error Is it possible to silently fail if there aren't any css files ? or to show message vs throwing error. I want to use this as part of my build process |
It will show a message if no file matched: https://github.com/morishitter/stylefmt/blob/master/bin/cli.js#L103
Try One more thing, use master branch: |
still not working :( ./node_modules/.bin/stylefmt -l src/**/*.css returns: Here is the branch i am testing on: https://github.com/noahehall/udacity-trainschedule/tree/serviceworkers |
I didn't find any problems in your branch. E:\work\udacity-trainschedule (serviceworkers) (udacity-trainschedule@0.1.1)
λ .\node_modules\.bin\stylefmt -l src/**/*.css
No files are formatted.
E:\work\udacity-trainschedule (serviceworkers) (udacity-trainschedule@0.1.1)
λ .\node_modules\.bin\stylefmt -l src/**/*.css --diff
src/components/forms/calendar.css
There is no difference with the original file.
src/components/forms/inputmoment.css
There is no difference with the original file.
src/components/forms/slider.css
There is no difference with the original file.
src/components/forms/time.css
There is no difference with the original file.
src/components/forms/variables.css
There is no difference with the original file.
src/containers/main/main.css
There is no difference with the original file.
src/containers/notfound/notfound.css
There is no difference with the original file.
src/containers/page/page.css
There is no difference with the original file.
src/containers/start/daypicker.css
There is no difference with the original file.
src/containers/start/start.css
There is no difference with the original file.
src/theme/colors.css
There is no difference with the original file. Then I changed one of your file (src/containers/start/start.css), and try again. If a file after format has no difference with original, CLI will not Overlay file. |
@gucong3000 Is it possible to list with globs from npm scripts? The following script in a pure bash works fine: Before v4 I did |
Got it. Sounds like I need to update the style rules, interesting thing is, in atom I am getting formatting errors. Ill review tonight and post updates |
@rosendi Can you give me a test case? |
@gucong3000 Just put in your package.json:
...then run |
@rosendi |
@rosendi please try
recursive pathes using glob have to use with quotes e.g. |
@morishitter Great! It works. Thank you! P.S. The glob pattern should be |
anytime :) |
Hey i cant seem to get the glob format working. Im trying to run ./node_modules/.bin/stylefmt --recursive 'client/src/common/**/*.less' but just keep getting a message saying files glob patterns specified did not match any css files. Please help! |
I just had the same problem and removed the quote mark '' around the path and it worked. |
Doesn’t work for me too but I have “TypeError: Cannot read property 'forEach' of undefined” @sebelga When you omit quotes you’re using you shell expansion which may not work the same way on other platforms. Basically you just send a huge list of files to |
./node_modules/.bin/stylefmt -d -R ./src/*/.css
gives error: cannot read property forEach of undefined
The text was updated successfully, but these errors were encountered: