mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-17 15:29:25 +02:00
Refactor code
This commit is contained in:
@@ -1,15 +1,13 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
// var fs = require('fs')
|
|
||||||
var chalk = require('chalk')
|
var chalk = require('chalk')
|
||||||
var error = chalk.bold.red
|
|
||||||
var cli = require('../lib/cli.js')
|
var cli = require('../lib/cli.js')
|
||||||
var lib = require('../lib')
|
var lib = require('../lib')
|
||||||
|
|
||||||
cli.parse(process.argv.slice(2), function (err, message, options) {
|
cli.parse(process.argv.slice(2), function (err, message, options) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(
|
console.error(
|
||||||
error('\nYou had errors in your syntax. Use --help for further information.')
|
chalk.bold.red('\nYou had errors in your syntax. Use --help for further information.')
|
||||||
)
|
)
|
||||||
err.forEach(function (e) {
|
err.forEach(function (e) {
|
||||||
console.error(e.message)
|
console.error(e.message)
|
||||||
|
@@ -1,26 +0,0 @@
|
|||||||
'use strict'
|
|
||||||
|
|
||||||
var Stream = require('stream')
|
|
||||||
// var Path = require('path')
|
|
||||||
|
|
||||||
function gulpRename (obj) {
|
|
||||||
var stream = new Stream.Transform({objectMode: true})
|
|
||||||
|
|
||||||
// function parsePath (path) {
|
|
||||||
// var extname = Path.extname(path)
|
|
||||||
// return {
|
|
||||||
// dirname: Path.dirname(path),
|
|
||||||
// basename: Path.basename(path, extname),
|
|
||||||
// extname: extname
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
stream._transform = function (file, unused, callback) {
|
|
||||||
console.log('a file')
|
|
||||||
callback(null, file)
|
|
||||||
}
|
|
||||||
|
|
||||||
return stream
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = gulpRename
|
|
1
todo.md
1
todo.md
@@ -3,3 +3,4 @@
|
|||||||
- Problem is it's for d3 v4 only
|
- Problem is it's for d3 v4 only
|
||||||
- node console output colors like Chrome console
|
- node console output colors like Chrome console
|
||||||
- default theme doesn't work for class diagram
|
- default theme doesn't work for class diagram
|
||||||
|
- mermaidAPI.js cannot be required directly
|
||||||
|
Reference in New Issue
Block a user