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

parents, dest handling with cwd and handling of absolute paths #8

Closed

Conversation

schnittstabil
Copy link
Collaborator

This PR is on top of @kevva PR #4.

To sum it up:

  1. change parents behavior as discussed in Source paths always preserved #2 (incl. missing test mentioned in #4 comment)
  2. fix wrong dest handling with cwd
  3. fix handling of absolute paths

About 2.:

cpy(['hello.js'], 'dest', {cwd: 'cwd'} ...)

should copy the file cwd/hello.js to cwd/dest/hello.js, but copies to dest/hello.js atm.


if (!pathIsAbsolute(dest) && opts.cwd) {
dest = path.join(opts.cwd, dest);
}
Copy link
Owner

Choose a reason for hiding this comment

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

I think you can use path.resolve instead so don't have to check if it's absolute.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice, I hadn't thought of that. It is a pity that path.resolve(undefined, srcPath) does not work...

@sindresorhus
Copy link
Owner

Lgtm, @kevva?

@schnittstabil schnittstabil mentioned this pull request Mar 12, 2015
@schnittstabil schnittstabil deleted the kevva-parents branch March 14, 2015 13:41
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

3 participants