Skip to content

Commit

Permalink
Fix screenshot() for paths with 2+ periods (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
af committed May 27, 2015
1 parent 61b7717 commit 414af8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ exports.wait = function(/* args */) {

exports.screenshot = function (path, done) {
var formats = ['png', 'gif', 'jpeg', 'jpg', 'pdf'];
var ext = path.substring(path.indexOf('.') + 1);
var ext = path.match(/[^.]+$/);
if (!~formats.join(',').indexOf(ext)) {
done(new Error('Must include file extension in `path`.'));
}
Expand Down

0 comments on commit 414af8b

Please sign in to comment.