pillys / copy-dir Goto Github PK
View Code? Open in Web Editor NEWEasy used 'copy-dir', copy a file or directory to anothor path, when dist path or parent distpath not exist, it will create the directory automatically.
License: MIT License
Easy used 'copy-dir', copy a file or directory to anothor path, when dist path or parent distpath not exist, it will create the directory automatically.
License: MIT License
Is it possible to publish the latest to NPM? The package on NPM is two years out of date and doesn't include #8, which was merged in last year.
Hello!
when I use copydir.sync(source, dest); my source directory only has file no folder, then it run error: no such file or directory; but I add a empty folder to source directory ,it run ok ... can it only copy files?
Thanks!
copyDir('dir', 'destenation/dir', callback)复制文件夹,不管复制失败还是成功,callback都没有执行。但复制单个文件callback会执行。请问这是个bug吗?
Copied files seem to be assigned 644 permissions on ubuntu 16.04. Both the source directory and target parent folder are 755.
Is there a workaround for this?
loop();
used without determine the array length.
Hello!
Does copy-dir work on windows machines as well? I have none to test on.
The package fs-extra provides a copy method that seems to do what this package does, and more.
I'm asking this because it is desirable if the ecosystem is clean and free from redundancies. Consider removing this package if it doesn't bring anything new. Alternatively merge with fs-extra.
I'm not affiliated with fs-extra or anything like this. It just seems fs-extra is the de-facto standard for enhanced fs operations.
I am getting :
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory.
after I switched to from node 7.5 to node 8.4.
Please add typescript support
when copying folder, its not deleting the previous files, is there any way to avoid merge and overwrite the folder
Any chance of getting a index.d.ts
file for this project, so we can use it with TypeScript?
I'm happy to help with this - I'd imagine the typings would look similar to cross-spawn
s in terms of export (the actual function definition would be different of course).
As the title says. I had to check the commit that using filter (which I'm indeed using) has changed.
I just implemented a similar private library that allows to transform the content of a file.
(recursively)
I would like to switch to yours. Do you think content transformation is something that would fit into your library?
The main idea is to optionally have a transform
argument, like this (in TypeScript to make types clear):
const options = {
transform: (data: string) => string = ...
};
copydir("from", "to", options, ...);
This is not mentioned in the documentation. Please add an option to prevent this from happening or at least add a warning to the readme.
The readme has the filter looking like this:
function(stat, filepath, filename){
However, in v1 this has changed to be:
function(stat, filepath, filedirectory){
This is a pretty breaking change, and one that is completely undocumented.
(First run is using v1.1.0
, second is the same file with v0.4.0
)
You are missing error handling inside the tools.find call here:
tools.find(function(err, list) {
var dirs = list.dirs.map(function(v) { // right here, where are you checking whether "err" exists? You aren't.
return path.join(tools.to, path.relative(tools.from, v));
}).concat([tools.to]);
tools.mkdir(dirs, function(err) {
tools.copyfile(list.files, callback);
});
});
In this call within my code, an error is happening, but your code does not handle the error, it just ignores it. This results in a fatal error because list
is undefined.
Try to copy /home/user/.config/google-chrome/Default/Local\ Extension\ Settings
and fail
what will "sync" return if function works correctly or got error?
I want to copy some directories with files in it ,beacause I just need the Content folder and Scripts Folder,So I write it like this:
copyDir.sync(copyDirOrFilePath,mkdirpath,function (stat, filepath, filename) {
if (stat==="directory"&&(filename ==="Content"||filename==="Scripts")) {
return true;
}
}
return false;
})
after I run gulp task , the Folder is copied, but files in Folder are not copy.
Is the copy operation (copydirSync or/and copydir ) here atomic?
If yes, is it at the directory level or file level?
No compatible version found: [email protected]
error Windows_NT 6.1.7601
error argv "C:\Program Files\nodejs\node.exe" "C:\Users\yangyong\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "copy-dir"
error node v4.4.7
error npm v3.10.5
error No compatible version found: [email protected]
error Valid install targets:
error 0.3.0, 0.2.0, 0.1.0, 0.0.8
If from directory do not contains any sub directory, copy-dir will not work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.