rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.13k stars 552 forks source link

Invalid cross-device link #183

Open bkabrda opened 13 years ago

bkabrda commented 13 years ago

Using thor 0.15.0.rc2, running the tests, I get 1 failure:

Thor::Actions::CreateLink#invoke! creates a hard link for :symbolic => false Failure/Error: capture(:stdout){ @action.invoke! } Errno::EXDEV: Invalid cross-device link - (/tmp/config.rb20111010-1025-sqmntf, /home/bkabrda/test/thor/spec/sandbox/doc/config.rb)

rspec ./spec/actions/create_link_spec.rb:36 # Thor::Actions::CreateLink#invoke! creates a hard link for :symbolic => false

The invalid cross-device link error occured probably due to the fact that /tmp/config.rb20111010-1025-sqmntf and /home/bkabrda/test/thor/spec/sandbox/doc/config.rb are on different partitions.

I'm not sure where this function is used, but either it never links two files on different partitions/filesystems and then the test should be repaired or it can and then the actual thor function should be fixed.

Thank you, Bohuslav Kabrda.

eventualbuddha commented 13 years ago

The tests assume that the temporary directory provided will be on the same device as the Thor source itself. Clearly this is sometimes not the case and should be fixed in the specs. The exception raised by ruby is appropriate. A patch that fixes the specs would be welcome!

bkabrda commented 13 years ago

I'm not completely sure, but wouldn't trying to link two files in /tmp suffice?

eventualbuddha commented 13 years ago

Most likely, yeah.

-bd

On Oct 11, 2011, at 1:04 AM, bkabrdareply@reply.github.com wrote:

I'm not completely sure, but wouldn't trying to link two files in /tmp suffice?

Reply to this email directly or view it on GitHub: https://github.com/wycats/thor/issues/183#issuecomment-2358261