Commit 92bda91c authored by rockyl's avatar rockyl

cli wrapper

parent 65674b2e
......@@ -6,9 +6,9 @@ const os = require('os');
const path = require('path');
const fs = require('fs-extra');
const {generateDeclareMap} = require('../src/index');
export async function execute(program){
if(!program.input || !program.output){
exports.execute = async function (program) {
if (!program.input || !program.output) {
console.warn('parameter is incorrect');
process.exit(1);
}
......@@ -35,11 +35,11 @@ export async function execute(program){
declareFilter
);
if(program.verbose){
if (program.verbose) {
console.log(result);
}
if(Object.keys(result.missingDependencies).length > 0){
if (Object.keys(result.missingDependencies).length > 0) {
console.warn(JSON.stringify(result.missingDependencies, null, '\t'));
process.exit(2);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment