From d99b43cb16175a39dac05442cd7dcb43836a70a6 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Fri, 2 Jun 2017 17:31:36 -0300 Subject: [PATCH] Fix Uncrustify's Executable version parser, newer Uncrustify is different format --- src/beautifiers/uncrustify/index.coffee | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/beautifiers/uncrustify/index.coffee b/src/beautifiers/uncrustify/index.coffee index 3d75ae6..0a8cac3 100644 --- a/src/beautifiers/uncrustify/index.coffee +++ b/src/beautifiers/uncrustify/index.coffee @@ -18,7 +18,14 @@ module.exports = class Uncrustify extends Beautifier homepage: "http://uncrustify.sourceforge.net/" installation: "https://github.com/uncrustify/uncrustify" version: { - parse: (text) -> text.match(/uncrustify (\d+\.\d+)/)[1] + ".0" + parse: (text) -> + try + v = text.match(/uncrustify (\d+\.\d+)/)[1] + catch error + @error(error) + v = text.match(/Uncrustify-(\d+\.\d+)/)[1] if not v? + if v + return v + ".0" } } ] @@ -94,9 +101,7 @@ module.exports = class Uncrustify extends Beautifier outputFile = @tempFile("output", text) "-l" lang - ], help: { - link: "http://sourceforge.net/projects/uncrustify/" - }) + ]) .then(=> @readFile(outputFile) )