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

#copy deletes contents of directory #395

Closed
OzairP opened this issue Mar 17, 2017 · 2 comments
Closed

#copy deletes contents of directory #395

OzairP opened this issue Mar 17, 2017 · 2 comments

Comments

@OzairP
Copy link

OzairP commented Mar 17, 2017

Environment

OS: OSX El Capitan 10.11.6
Node: v7.6.0 (using NVM) (As per #358)
NPM: 4.1.2
FS-Extra version:

├─┬ [email protected]
│ └── [email protected] 
└── [email protected] 

Code

import fs from "fs-extra";

fs.copy("../../Steam/GameCache/csgo/", "../../Users/Ozair/csgo_23", {"overwrite": true}, err => {
     if(err)
          reject(err);
     else
          fulfill("Transfer successful");
});

FS-Extra deletes the contents of the source directory and no files move onto the destination.

@manidlou
Copy link
Collaborator

@OzairP is there any specific reasons that you run very old version @1.0.0 of fs-extra? As you probably know, the latest release is v2.1.2.

@OzairP
Copy link
Author

OzairP commented Mar 17, 2017

Actually, it seems that I misread the documentation. I called emptyDirSync under the assumption that it checks if the dir is empty, but I was wrong when rereading the documentation. I apologize about that.

@OzairP OzairP closed this as completed Mar 17, 2017
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

No branches or pull requests

2 participants