postcss/postcss-cli

Can not copy folder with --base --dir

Closed this issue · 11 comments

Try to make a copy of all file and folder in css folder to main folder but not working.
It just copy files.
"watch:css": "postcss src/styles/css/* --base --dir src/styles/main/ -w",

   src
     |___styles
            |____css
            |____main

"not working" doesn't tell me much; what kind of "not working"? Are you getting an error message, or does nothing happen, or is something happening different than you expect?

@RyanZim it not getting any error but it just copy files. I want to copy folder too

Oh, I missed that bit. Reason is you're only globbing for the files in that folder: src/styles/css/*. If you want to include subfolders, you need to do src/styles/css/**/*. Hope that helps!

@RyanZim
It just copy files in the subfolders.
It return only sort.css in main folder( don't have trainee folder and another css files out side like common.css )

   src
     |___styles
            |____css
                   |____trainee
                               |____sort.css
                   |____common.css
            |____main

Sorry man, it's been a long time since I've used these options, I'm forgetting how stuff works. Had to experiment myself; the correct command is postcss src/styles/css/**/* --base src/styles/css/ --dir src/styles/main/

@RyanZim Thank you but it not over yet =)). This time it had the subfolder and the file in side it but didn't has the file out side. in this case is common.css

What OS are you on? You may need to quote the input glob for proper parsing.

@RyanZim I use MacOS

Yeah, try putting the src/styles/css/**/* bit in quotes

@RyanZim thank you. It's working now. By the way, is it still working with different OS?

On some linux, it would work without the quotes. IDR if quotes are required on Windows.