Skip to content

Fix for #44#46

Merged
arturadib merged 2 commits intoshelljs:masterfrom
mstade:master
Dec 24, 2012
Merged

Fix for #44#46
arturadib merged 2 commits intoshelljs:masterfrom
mstade:master

Conversation

@mstade
Copy link
Copy Markdown
Contributor

@mstade mstade commented Dec 24, 2012

This should fix #44, and get cp more inline with its shell counter part. Included tests for the cases mentioned in the issue.

@mstade
Copy link
Copy Markdown
Contributor Author

mstade commented Dec 24, 2012

This is admittedly a pretty naive fix, but should get someone who's more familiar with the code base going in the right direction anyway.

@arturadib arturadib merged commit 37c00b1 into shelljs:master Dec 24, 2012
@arturadib
Copy link
Copy Markdown
Collaborator

hey many thanks for this. I've made some changes to comply with *nix behavior (only create dest dir if it's one level deep), and simplified the logic and tests a bit in cba4f22 (sorry, my editor also removed a bunch of trailing spaces making the diff hard to read)

@arturadib
Copy link
Copy Markdown
Collaborator

PS: but your two commits are in the tree of course! :)

@mstade
Copy link
Copy Markdown
Contributor Author

mstade commented Dec 25, 2012

Very cool, thanks! :)

@mstade
Copy link
Copy Markdown
Contributor Author

mstade commented Dec 25, 2012

Sorry to bring this up again, but when I run npm test locally with the current head of master, I get the following:

shell.js: internal error
Error: ENOENT, no such file or directory 'tmp/dir2/dir3/lib'
    at Object.fs.mkdirSync (fs.js:483:18)
    at /Users/mstade/Dropbox/dev/stade/shelljs/shell.js:315:14
    at Array.forEach (native)
    at Object._cp (/Users/mstade/Dropbox/dev/stade/shelljs/shell.js:298:11)
    at Object.cp (/Users/mstade/Dropbox/dev/stade/shelljs/shell.js:1080:23)
    at Object.<anonymous> (/Users/mstade/Dropbox/dev/stade/shelljs/test/cp.js:139:7)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
*** TEST FAILED! (missing exit code "123")

If I comment out the last test block in test/cp.js it passes fine. Not sure what causes it, and am sort of pressed for time at the moment (focusing on trying to implement pushd/popd as per #24 at the moment,) but if I figure it out I'll make sure to get back to you. Just figured I'd drop a note about it.

Here's some machine info, in case it's useful:

$ uname -v
Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64

@mstade
Copy link
Copy Markdown
Contributor Author

mstade commented Dec 25, 2012

Also, node version:

$ node -v
v0.8.14

@mstade
Copy link
Copy Markdown
Contributor Author

mstade commented Dec 26, 2012

Silly me had screwed up the merge of your master into my fork, it's all good. My bad, please ignore!

@arturadib
Copy link
Copy Markdown
Collaborator

pheew! :)

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.

Inconsistent behaviour of cp command with directories.

2 participants