mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-14 17:54:13 +01:00
Auto fix standard style voilations
This commit is contained in:
47
lib/index.js
47
lib/index.js
@@ -1,7 +1,7 @@
|
||||
var os = require('os')
|
||||
, fs = require('fs')
|
||||
, path = require('path')
|
||||
, spawn = require('child_process').spawn
|
||||
var os = require('os'),
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
spawn = require('child_process').spawn
|
||||
|
||||
var mkdirp = require('mkdirp')
|
||||
|
||||
@@ -9,32 +9,31 @@ var phantomscript = path.join(__dirname, 'phantomscript.js')
|
||||
|
||||
module.exports = { process: processMermaid }
|
||||
|
||||
function processMermaid(files, _options, _next) {
|
||||
var options = _options || {}
|
||||
, outputDir = options.outputDir || process.cwd()
|
||||
, outputSuffix = options.outputSuffix || ''
|
||||
, next = _next || function() {}
|
||||
, phantomArgs = [
|
||||
phantomscript
|
||||
, outputDir
|
||||
, options.png
|
||||
, options.svg
|
||||
, options.css
|
||||
, options.sequenceConfig
|
||||
, options.ganttConfig
|
||||
, options.verbose
|
||||
, options.width
|
||||
, outputSuffix
|
||||
];
|
||||
function processMermaid (files, _options, _next) {
|
||||
var options = _options || {},
|
||||
outputDir = options.outputDir || process.cwd(),
|
||||
outputSuffix = options.outputSuffix || '',
|
||||
next = _next || function () {},
|
||||
phantomArgs = [
|
||||
phantomscript,
|
||||
outputDir,
|
||||
options.png,
|
||||
options.svg,
|
||||
options.css,
|
||||
options.sequenceConfig,
|
||||
options.ganttConfig,
|
||||
options.verbose,
|
||||
options.width,
|
||||
outputSuffix
|
||||
]
|
||||
|
||||
files.forEach(function(file) {
|
||||
files.forEach(function (file) {
|
||||
phantomArgs.push(file)
|
||||
})
|
||||
|
||||
mkdirp(outputDir, function(err) {
|
||||
mkdirp(outputDir, function (err) {
|
||||
if (err) {
|
||||
throw err
|
||||
return
|
||||
}
|
||||
phantom = spawn(options.phantomPath, phantomArgs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user