-
Notifications
You must be signed in to change notification settings - Fork 759
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
Source single file gist without filename; fixes #1266 #1268
Conversation
This fixes an issue in which an attempt to source a gist containing a single filename, but without specifying that filename, fails. Fixes issue #1266.
The issue page /issues/1266 seems to indicate this has been fixed, but I'm getting the same error as @Cauchy2. I've updated devtools and attempted to call gist_source() but to no avail.
I'm a bit of a novice with this stuff so apologies in advance if i'm missing something simple! |
@@ -137,8 +137,8 @@ find_gist <- function(id, filename) { | |||
} | |||
|
|||
} else { | |||
if (length(r_files) > 1) { | |||
warning("Multiple R files in gist, using first.") | |||
if (length(r_files) >= 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather confusing logic. I think it would be better as:
if (length(r_files) == 1) {
...
} else {
...
}
Presumably zero files should also be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I'll adjust accordingly. You already exit with an error when length(r_files) == 0
so no additional modification is necessary. Thanks!
@@ -137,7 +137,9 @@ find_gist <- function(id, filename) { | |||
} | |||
|
|||
} else { | |||
if (length(r_files) > 1) { | |||
if (length(r_files) = 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
?
Of course. Thanks for your patience... |
Sorry, I forgot about your PR and ended up fixing by hand. |
This fixes an issue in which an attempt to source a gist containing a single filename, but without specifying that filename, fails. Fixes issue #1266.