Commit 733de042 authored by rockyl's avatar rockyl

去除掉ts编译的中间过程

parent 2ded3caf
......@@ -11,35 +11,32 @@ const glob = require('glob');
exports.execute = async function (program) {
const inputFile = program.input;
if(await fs.exists(inputFile)){
if (await fs.exists(inputFile)) {
const stat = await fs.stat(inputFile);
if(stat.isDirectory()){
if (stat.isDirectory()) {
const indexFiles = glob.sync(path.join(inputFile, '**/index.ts'));
let code, params = {
let params = {
projectPath: program.projectPath,
};
for(let file of indexFiles){
for (let file of indexFiles) {
console.log(file);
params.input = file;
code = await executeDeclareGenerator(params);
if(code > 0){
return code;
}
code = await executeTsCompiler(params);
if(code > 0){
return code;
}
await executeFile(program);
}
}else{
let code;
code = await executeDeclareGenerator(program);
if(code > 0){
return code;
}
return await executeTsCompiler(program);
} else {
await executeFile(program);
}
}
return 10
};
async function executeFile(params) {
let code;
code = await executeDeclareGenerator(params);
if (code > 0) {
return code;
}
//return await executeTsCompiler(params);
}
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