GithubHelp home page GithubHelp logo

cp skipping dot files? about shelljs HOT 5 CLOSED

shelljs avatar shelljs commented on May 21, 2024 1
cp skipping dot files?

from shelljs.

Comments (5)

paulvi avatar paulvi commented on May 21, 2024

I ran into the same problem. The README DOES NOT mention this behavior.
-A option for cp is not implemented.

from shelljs.

paulvi avatar paulvi commented on May 21, 2024

Looking at source https://github.com/arturadib/shelljs/blob/master/src/cp.js found https://github.com/ryanmcgrath/wrench-js wrench.js - Recursive file operations in Node.js

from shelljs.

paulvi avatar paulvi commented on May 21, 2024

https://github.com/arturadib/shelljs/blob/master/src/cp.js#L64

var files = fs.readdirSync(sourceDir);

is where the folder is read, fs.readdirSync returns list of folder content including .files and folders (tested).

but checking the whole block https://github.com/arturadib/shelljs/blob/master/src/cp.js#L64-L84 I see no wrong.

from shelljs.

arturadib avatar arturadib commented on May 21, 2024

That's on purpose. If you run cp -R foo/* bar on Unix it also won't copy dot files. ShellJS tries to mock Unix's behavior as closely as possible.

from shelljs.

paulvi avatar paulvi commented on May 21, 2024

Well, it should be nice to mention that as warning in docs

(as shell.js has not yet implemented all cp options)

from shelljs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.