Commit ce220d6a authored by rockyl's avatar rockyl

抽离common-component-list

parent 0b420f41
...@@ -29,7 +29,6 @@ function getAllDependencies(dependencies, missingDependencies, componentName, ve ...@@ -29,7 +29,6 @@ function getAllDependencies(dependencies, missingDependencies, componentName, ve
}else{ }else{
missingDependencies[key] = temp[key]; missingDependencies[key] = temp[key];
} }
} }
} }
} }
...@@ -41,10 +40,12 @@ exports.execute = async function (program) { ...@@ -41,10 +40,12 @@ exports.execute = async function (program) {
return 1; return 1;
} }
const componentsPath = program.projectPath || path.join(os.homedir(), '.scilla', 'components');
const projectPath = program.projectPath || process.cwd();
const componentsPath = path.join(os.homedir(), '.scilla', 'components');
const componentsSrcPath = path.join(componentsPath, 'src'); const componentsSrcPath = path.join(componentsPath, 'src');
const tsconfig = fs.readJsonSync(path.join(componentsPath, 'tsconfig.json')); const tsconfig = fs.readJsonSync('tsconfig.json');
const inputFile = program.input; const inputFile = program.input;
const inputFileFolder = path.dirname(inputFile); const inputFileFolder = path.dirname(inputFile);
...@@ -61,8 +62,6 @@ exports.execute = async function (program) { ...@@ -61,8 +62,6 @@ exports.execute = async function (program) {
return result; return result;
} }
const projectPath = process.cwd();
function declareFilter(source) { function declareFilter(source) {
return source.fileName.indexOf(inputFileFolder) >= 0; return source.fileName.indexOf(inputFileFolder) >= 0;
} }
...@@ -71,7 +70,7 @@ exports.execute = async function (program) { ...@@ -71,7 +70,7 @@ exports.execute = async function (program) {
tsconfig, tsconfig,
dependencies, dependencies,
inputFile, inputFile,
componentsSrcPath, componentsPath,
projectPath, projectPath,
null, null,
declareFilter declareFilter
......
File mode changed from 100644 to 100755
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