Skip to content

Commit

Permalink
tweak formatter detection
Browse files Browse the repository at this point in the history
  • Loading branch information
autc04 committed Sep 26, 2019
1 parent f2f80e3 commit 762bb2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ def generate_header(header)

def formatted_file(name, &block)
if not @format_command then
if system('clang-format --version > /dev/null') then
if system('clang-format --version', [:out, :err]=>"/dev/null") then
@format_command = "clang-format | grep -v \"// clang-format o\""
elsif system('uncrustify --version > /dev/null') then
elsif system('uncrustify --version', [:out, :err]=>"/dev/null") then
@format_command = "uncrustify -q -c uncrustify.cfg | grep -v \"// clang-format o\""
elsif system('astyle --version > /dev/null') then
elsif system('astyle --version', [:out, :err]=>"/dev/null") then
@format_command = "astyle --style=allman --max-code-length=79 --mode=c | grep -v \"// clang-format o\""
else
@format_command = "grep -v \"// clang-format o\""
Expand Down

0 comments on commit 762bb2e

Please sign in to comment.