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

Getting a success indicator in TTY::File.copy_file() #13

Open
rom3r4 opened this issue Feb 4, 2021 · 0 comments
Open

Getting a success indicator in TTY::File.copy_file() #13

rom3r4 opened this issue Feb 4, 2021 · 0 comments

Comments

@rom3r4
Copy link

rom3r4 commented Feb 4, 2021

Describe the problem

I noticed that unlike TTY::File.copy_directory(), TTY::File.copy_file() does't return a value on success.
Would be possible that both methods behave similar?

Steps to reproduce the problem

# Need of rescuing the method in order to know about the success 

begin
  TTY::File.copy_file(  ...  )
rescue
  success = false
  ...
else
  success = true
end

Actual behaviour

result = TTY::File.copy_file()
# result == nil in both error and success

Expected behaviour

Equivalent to its 'brother' method TTY::File.copy_directory()

Describe your environment

  • OS version: macOS Big Sur 11.2
  • Ruby version: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin20]
  • TTY version: tty-file-0.10.0
rom3r4 added a commit to rom3r4/tty-file that referenced this issue Feb 5, 2021
…does not exist, destination is a directory corner cases. piotrmurach#13
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

1 participant