Switch Crystal beautifier to using Executables
This commit is contained in:
parent
738847c156
commit
349edae0fd
|
@ -8,24 +8,24 @@ Beautifier = require('./beautifier')
|
|||
module.exports = class Crystal extends Beautifier
|
||||
name: "Crystal"
|
||||
link: "http://crystal-lang.org"
|
||||
isPreInstalled: false
|
||||
executables: [
|
||||
{
|
||||
name: "Crystal"
|
||||
cmd: "crystal"
|
||||
homepage: "http://crystal-lang.org"
|
||||
installation: "https://crystal-lang.org/docs/installation/"
|
||||
version: {
|
||||
parse: (text) -> text.match(/Crystal (\d+\.\d+\.\d+)/)[1]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
options: {
|
||||
Crystal: false
|
||||
}
|
||||
|
||||
beautify: (text, language, options) ->
|
||||
# Seems that Crystal dosen't have Windows support yet.
|
||||
if @isWindows
|
||||
@Promise.reject(@commandNotFoundError(
|
||||
'crystal'
|
||||
{
|
||||
link: "http://crystal-lang.org"
|
||||
program: "crystal"
|
||||
})
|
||||
)
|
||||
else
|
||||
@run("crystal", [
|
||||
@exe("crystal").run([
|
||||
'tool',
|
||||
'format',
|
||||
tempFile = @tempFile("temp", text)
|
||||
|
|
Loading…
Reference in New Issue