Giter Site home page Giter Site logo

How to copy dir? about cpx HOT 8 OPEN

mysticatea avatar mysticatea commented on May 18, 2024
How to copy dir?

from cpx.

Comments (8)

harapeko avatar harapeko commented on May 18, 2024 10

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

from cpx.

mysticatea avatar mysticatea commented on May 18, 2024 1

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.

from cpx.

aderchox avatar aderchox commented on May 18, 2024 1

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\""
  },

from cpx.

corysimmons avatar corysimmons commented on May 18, 2024

cpx src dist doesn't work?

from cpx.

mysticatea avatar mysticatea commented on May 18, 2024

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.

from cpx.

corysimmons avatar corysimmons commented on May 18, 2024

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

from cpx.

lunatolun avatar lunatolun commented on May 18, 2024

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

from cpx.

steelx avatar steelx commented on May 18, 2024

following works for me:

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

from cpx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.