mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 21:09:50 +02:00
Fix for issue #150.
This commit is contained in:
@@ -98,6 +98,7 @@ cli.prototype.parse = function(argv, next) {
|
||||
|
||||
|
||||
if (options.ganttConfig) {
|
||||
console.log('Got conf1'+options.ganttConfig);
|
||||
options.ganttConfig = checkConfig(options.ganttConfig)
|
||||
console.log('Got conf'+options.ganttConfig);
|
||||
}
|
||||
@@ -128,10 +129,11 @@ cli.prototype.parse = function(argv, next) {
|
||||
|
||||
function checkConfig(configPath) {
|
||||
try {
|
||||
var text = fs.readFileSync(configPath, 'utf8')
|
||||
var text = fs.readFileSync(configPath, 'utf8');
|
||||
JSON.parse(text)
|
||||
return text
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user