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

Check the file input #13

Closed
wants to merge 1 commit into from
Closed

Check the file input #13

wants to merge 1 commit into from

Conversation

kirs
Copy link

@kirs kirs commented Oct 8, 2015

Otherwise it crashes when I run it without the first arguments:

$ bin/tkn

bin/tkn:277:in `mtime': no implicit conversion of nil into String (TypeError)
    from bin/tkn:277:in `block in <main>'
    from bin/tkn:274:in `loop'
    from bin/tkn:274:in `<main>'

(I wanted to run the tkn binary without args to see the help)

@fxn
Copy link
Owner

fxn commented Oct 10, 2015

The first check is fine.

The second one... I don't like generally check exists? manually. That's
something you get automatically when you try to access the file. What if
the file exists but permissions are not enough?

In principle I'd prefer that control near the mtime and/or load calls.

El jueves, 8 de octubre de 2015, Kir Shatrov notifications@github.com
escribió:

Otherwise it crashes when I run it without the first arguments:

$ bin/tkn

bin/tkn:277:in mtime': no implicit conversion of nil into String (TypeError) from bin/tkn:277:inblock in

'
from bin/tkn:274:in loop' from bin/tkn:274:in'

(I wanted to run the tkn binary without args to see the help)

You can view, comment on, or merge this pull request online at:

#13
Commit Summary

  • Check file input

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#13.

Sent from Gmail Mobile

@fxn
Copy link
Owner

fxn commented Oct 10, 2015

Ah! Also no need for blank? here, this is the command line, checking ARGV.length or nil? would suffice.

@fxn fxn closed this in 21cf737 Apr 23, 2016
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.

2 participants