Skip to content
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 copy dir? #28

Open
corysimmons opened this issue Apr 15, 2017 · 8 comments
Open

How to copy dir? #28

corysimmons opened this issue Apr 15, 2017 · 8 comments

Comments

@corysimmons
Copy link

No description provided.

@mysticatea
Copy link
Owner

Thank you for the question.

Directories which have some content files will be copied automatically.
If you want to copy empty directories, use --include-empty-dirs option.

@corysimmons
Copy link
Author

cpx src dist doesn't work?

@mysticatea
Copy link
Owner

mysticatea commented Apr 18, 2017

Currently, no.
I have designed this tool to copy specific files as companion to transpilers. I had not thought copying directories. The feature would be useful.

@corysimmons
Copy link
Author

No problem. For anyone else stumbling upon this in the interim (or if you want to borrow some code) https://www.npmjs.com/package/ncp can do this.

Thanks for your work @mysticatea

@harapeko
Copy link

harapeko commented Feb 2, 2018

i have an idea !

cpx "favicons/**/*.*" ./dest

target

android-chrome-144x144.png
android-chrome-192x192.png
android-chrome-36x36.png
android-chrome-48x48.png
android-chrome-72x72.png
android-chrome-96x96.png
apple-touch-icon-114x114-precomposed.png
apple-touch-icon-114x114.png
apple-touch-icon-120x120-precomposed.png
apple-touch-icon-120x120.png
apple-touch-icon-144x144-precomposed.png
apple-touch-icon-144x144.png
apple-touch-icon-152x152-precomposed.png
apple-touch-icon-152x152.png
apple-touch-icon-180x180-precomposed.png
apple-touch-icon-180x180.png
apple-touch-icon-57x57-precomposed.png
apple-touch-icon-57x57.png
apple-touch-icon-60x60-precomposed.png
apple-touch-icon-60x60.png
apple-touch-icon-72x72-precomposed.png
apple-touch-icon-72x72.png
apple-touch-icon-76x76-precomposed.png
apple-touch-icon-76x76.png
apple-touch-icon-precomposed.png
apple-touch-icon.png
browserconfig.xml
favicon-160x160.png
favicon-16x16.png
favicon-196x196.png
favicon-32x32.png
favicon-48x48.png
favicon-96x96.png
favicon.ico
manifest.json
mstile-144x144.png
mstile-150x150.png
mstile-310x150.png
mstile-310x310.png
mstile-70x70.png

however, this is not perfect...
its without filename extension

ex) readme

@lunatolun
Copy link

this works fine for me, without configuring file extensions. packages folder has 4-5 more folders, with different files in them. not sure if this was the exact question.

"scripts": {
    "start": "yarn watchChanges",
    "watchChanges": "cpx \"packages/**\" \"web/src\" --watch & cpx \"packages/**\" \"mobile/src\" --watch"
  }

@steelx
Copy link

steelx commented May 11, 2021

following works for me:

cpx "icons/**" build/icons && ..

@aderchox
Copy link

aderchox commented Jul 5, 2022

I need this and I also think adding this feature would be great.

P.S. for future readers: I achieved it like this (notice how the assets directory has been copied):

  "scripts": {
    "dev": "concurrently \"npx cpx src/static/**/* dist --watch\" \"npx cpx manifest.json dist --watch\" \"npx cpx assets/**/* dist/assets\" \"npx tsc --watch\""
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants