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

feat: recursive copying with --up #89

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

sgtrusty
Copy link

@sgtrusty sgtrusty commented Aug 2, 2021

No description provided.

@sgtrusty
Copy link
Author

sgtrusty commented Aug 2, 2021

needed for sindresorhus/cpy-cli#33

index.d.ts Outdated

@default 0
*/
readonly up?: boolean;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good option name. Maybe trimPathComponents or something.

index.js Outdated
if ((path.normalize(source).split(path.sep).length - 1) < up) {
throw new Error('cant go up that far');
}
return path.join(path.normalize(source).split(path.sep).slice(up));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use tab-indentation.

index.js Outdated
if (!up) {
return source;
}
if (up === true) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case is not documented.

@sindresorhus
Copy link
Owner

This will need tests.

@sindresorhus
Copy link
Owner

Note that things have changed since you started this: https://github.com/sindresorhus/cpy/releases/tag/v9.0.0

Copy link

@tornadia tornadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sindresorhus please see changes commited

readme.md Outdated Show resolved Hide resolved
readme.md Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.d.ts Show resolved Hide resolved
@sgtrusty
Copy link
Author

sgtrusty commented Aug 29, 2022

Sorry, been a bit busy. Gonna check em out and jump on it, thanks @sindresorhus

Edit: changes commited! Thanks for your patience.

```

Where the destination paths of `*.js` files within subdirectories of the `src` directory
will be flattened to a reduced structure another `destination/flatSourceFiles` path.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't hard-wrap.

This is missing from index.d.ts

And I think it needs a rewrite. I don't really understand what it's trying to say.

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

Successfully merging this pull request may close these issues.

None yet

4 participants