From 6aee12ba805abc08624ee755c3314e0f7cde83e0 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Fri, 16 Jun 2017 20:54:29 -0300 Subject: [PATCH] See #1687. Add Docker executable support for Sass-convert beautifier --- docs/options.md | 17 +++++++++++++++++ src/beautifiers/sass-convert.coffee | 18 +++++++++++++++--- src/options.json | 16 ++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/docs/options.md b/docs/options.md index da8803578..d49a2fc1e 100644 --- a/docs/options.md +++ b/docs/options.md @@ -334,6 +334,23 @@ Options for Rscript executable. 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*Rscript*" and change it to your desired configuration. +##### [SassConvert](#sassconvert) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `object` + +**Description**: + +Options for SassConvert executable. + +**How to Configure** + +1. You can open the [Settings View](https://github.com/atom/settings-view) by navigating to +*Edit > Preferences (Linux)*, *Atom > Preferences (OS X)*, or *File > Preferences (Windows)*. +2. Go into *Packages* and search for "*Atom Beautify*" package. +3. Find the option "*SassConvert*" and change it to your desired configuration. + ##### [Uncrustify](#uncrustify) **Important**: This option is only configurable from within Atom Beautify's setting panel. diff --git a/src/beautifiers/sass-convert.coffee b/src/beautifiers/sass-convert.coffee index e53fa980f..5a8fe681a 100644 --- a/src/beautifiers/sass-convert.coffee +++ b/src/beautifiers/sass-convert.coffee @@ -4,7 +4,20 @@ Beautifier = require('./beautifier') module.exports = class SassConvert extends Beautifier name: "SassConvert" link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax" - isPreInstalled: false + executables: [ + { + name: "SassConvert" + cmd: "sass-convert" + homepage: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax" + installation: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax" + version: { + parse: (text) -> text.match(/Sass (\d+\.\d+\.\d+)/)[1] + } + docker: { + image: "unibeautify/sass-convert" + } + } + ] options: # TODO: Add support for options @@ -14,8 +27,7 @@ module.exports = class SassConvert extends Beautifier beautify: (text, language, options, context) -> lang = language.toLowerCase() - - @run("sass-convert", [ + @exe("sass-convert").run([ @tempFile("input", text), "--from", lang, "--to", lang ]) diff --git a/src/options.json b/src/options.json index 8456f2264..f70f67de5 100644 --- a/src/options.json +++ b/src/options.json @@ -9306,6 +9306,22 @@ } } }, + "sass-convert": { + "key": "sass-convert", + "title": "SassConvert", + "type": "object", + "collapsed": true, + "description": "Options for SassConvert executable.", + "properties": { + "path": { + "key": "path", + "title": "Binary/Script Path", + "type": "string", + "default": "", + "description": "Absolute path to the \"sass-convert\" executable's binary/script." + } + } + }, "rscript": { "key": "rscript", "title": "Rscript",