Skip to content

Commit

Permalink
Fix issue with occasional double forward-slashes in file path log out…
Browse files Browse the repository at this point in the history
…put..
  • Loading branch information
tashicorp committed Feb 25, 2017
1 parent d5ea905 commit 92f279c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/yaml-lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def do_lint
return 0
else
if File.directory? @file
return self.parse_directory @file
directory = format_directory(@file)
return self.parse_directory directory
else
return self.parse_file @file
end
Expand Down Expand Up @@ -82,4 +83,10 @@ def parse_file(file)
return 0
end
end

private

def format_directory(directory)
directory[-1] == '/' ? directory.chop : directory
end
end

0 comments on commit 92f279c

Please sign in to comment.