Commit 92bda91c authored by rockyl's avatar rockyl

cli wrapper

parent 65674b2e
...@@ -6,9 +6,9 @@ const os = require('os'); ...@@ -6,9 +6,9 @@ const os = require('os');
const path = require('path'); const path = require('path');
const fs = require('fs-extra'); const fs = require('fs-extra');
const {generateDeclareMap} = require('../src/index'); const {generateDeclareMap} = require('../src/index');
export async function execute(program){ exports.execute = async function (program) {
if(!program.input || !program.output){ if (!program.input || !program.output) {
console.warn('parameter is incorrect'); console.warn('parameter is incorrect');
process.exit(1); process.exit(1);
} }
...@@ -35,11 +35,11 @@ export async function execute(program){ ...@@ -35,11 +35,11 @@ export async function execute(program){
declareFilter declareFilter
); );
if(program.verbose){ if (program.verbose) {
console.log(result); 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')); console.warn(JSON.stringify(result.missingDependencies, null, '\t'));
process.exit(2); 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