Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Get filename using path.basename #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

martinvl
Copy link

When globbing for files (e.g. "foo.*") only the first file gets a correct fname. The other files get .. prepended to their fname, which causes them to be put in the wrong remote location.

Fixes #27

@lepture
Copy link
Contributor

lepture commented Aug 14, 2015

Imaging this:

  1. relative path: /foo
  2. file: /foo/bar/baz.txt

Using path.basename you will get baz.txt, but bar/baz.txt is expected.

@martinvl
Copy link
Author

That is true.

Check whether files[0] is a directory using fs.stat and use path.dirname if it isn't then?

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

Successfully merging this pull request may close these issues.

2 participants