postcss / postcss-cli

CLI for postcss
Other
840 stars 93 forks source link

Can not copy folder with --base --dir #323

Closed bocanhcam closed 4 years ago

bocanhcam commented 4 years ago

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
RyanZim commented 4 years ago

"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?

bocanhcam commented 4 years ago

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

RyanZim commented 4 years ago

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!

bocanhcam commented 4 years ago

@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
RyanZim commented 4 years ago

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/

bocanhcam commented 4 years ago

@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

RyanZim commented 4 years ago

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

bocanhcam commented 4 years ago

@RyanZim I use MacOS

RyanZim commented 4 years ago

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

bocanhcam commented 4 years ago

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

RyanZim commented 4 years ago

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