question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

simplify API for --parents option

See original GitHub issue

Hi,

If I want to copy all the html in assets directory and keep the directory structure inside dist directory I have to do the following command :

cpy '**/*.html' '../dist/' --cwd=assets --parents

I think the following command would be easier :

cpy 'assets/**/*.html' dist --parents
assets
├── index.html
├── robots.txt
└── test
    └── test.html

should return

dist
├── index.html
└── test
    └── test.html

not

dist
└── assets
    ├── index.html
    └── test
        └── test.html
npm -v
2.14.7

node -v
4.2.3

uname -a
Linux guillaume-x240 3.19.0-39-generic #44~14.04.1-Ubuntu SMP Wed Dec 2 10:00:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

here the red test https://github.com/guillaumevincent/cpy/commit/fad2b31882100ef914cc570cb84e8fd66b0197cf

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
guillaumevincentcommented, Dec 14, 2015

@schnittstabil you’re right, the first command is sufficient.

Maybe something in the doc :

$ cpy --help

  Usage
    $ cpy <source>... <destination> [--no-overwrite] [--parents] [--cwd=<dir>] [--rename=<filename>]

  Options
    --no-overwrite       Don't overwrite the destination
    --parents            Preseve path structure
    --cwd=<dir>          Working directory for source files
    --rename=<filename>  Rename all <source> filenames to <filename>

  <source> can contain globs if quoted

  Examples:
  Copy all png in src directory into dist except src/goat.png

    $ cpy 'src/*.png' '!src/goat.png' dist

  Copy all html inside src directory into dist and keep path structure

    $ cpy '**/*.html' '../dist/' --cwd=src --parents



0reactions
guillaumevincentcommented, Dec 14, 2015

@schnittstabil pull request #22 tell me if it’s not what you think

Read more comments on GitHub >

github_iconTop Results From Across the Web

How parental control APIs can help parents in the digital age
There is exceptional value in APIs that do everything parents need them to do to simplify protecting their children online.
Read more >
Hosted Payments Documentation | Simplify Commerce
Simplify Commerce's hosted payment form will display in as either a modal ... Options set using the JavaScript API apply to all the...
Read more >
OurFamilyWizard - Best Co-Parenting App for Child Custody
The OurFamilyWizard website, iOS and Android mobile apps help parents to manage child custody schedules and co-parenting information from separate homes.
Read more >
Clever: Single sign-on for education
One platform, always ready. With secure accounts, simplified logins, and a digital classroom to love, educators can ensure students are ready on the...
Read more >
Parents - API Equality—LA
A great resource sheet for parents whose child has just came out to them — what do you do now that your child...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found