mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
26 lines
504 B
JavaScript
Executable File
26 lines
504 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
import chalk from 'chalk'
|
|
|
|
import cli from '../lib/cli'
|
|
import lib from '../lib'
|
|
|
|
cli.parse(process.argv.slice(2), function (err, message, options) {
|
|
if (err) {
|
|
console.error(
|
|
chalk.bold.red('\nYou had errors in your syntax. Use --help for further information.')
|
|
)
|
|
err.forEach(function (e) {
|
|
console.error(e.message)
|
|
})
|
|
|
|
return
|
|
} else if (message) {
|
|
console.log(message)
|
|
|
|
return
|
|
}
|
|
|
|
lib.process(options.files, options, process.exit)
|
|
})
|