egg-controller
Advanced tools
Comparing version 0.1.14 to 0.1.15
@@ -13,5 +13,6 @@ "use strict"; | ||
const config = app.config.controller; | ||
const SDKDir = path.isAbsolute(config.SDKDir) ? config.SDKDir : path.join(app.baseDir, config.SDKDir); | ||
yield Promise.all([].concat(config.dir) | ||
.map(dir => path.isAbsolute(dir) ? dir : path.join(app.baseDir, dir)) | ||
.map((dir) => tslib_1.__awaiter(this, void 0, void 0, function* () { return meta_1.genAPISDKByPath(dir, config.SDKDir, config.templatePath); }))); | ||
.map((dir) => tslib_1.__awaiter(this, void 0, void 0, function* () { return meta_1.genAPISDKByPath(dir, SDKDir, config.templatePath); }))); | ||
console.log('[egg-controller] gen api sdk.'); | ||
@@ -18,0 +19,0 @@ }); |
@@ -11,2 +11,3 @@ "use strict"; | ||
}); | ||
console.log('[GenSDK]', files); | ||
} | ||
@@ -13,0 +14,0 @@ catch (error) { |
@@ -13,3 +13,3 @@ "use strict"; | ||
[].concat(ctrlDir).forEach(dir => { | ||
util_1.loadDir(dir, files); | ||
files.push(...util_1.loadDir(dir)); | ||
}); | ||
@@ -16,0 +16,0 @@ const p = child_process_1.fork(path.join(__dirname, 'gen_sdk_script.js'), null, { |
@@ -10,2 +10,2 @@ export declare function isGeneratorFunction(fn: any): boolean; | ||
export declare function getValue<T = any>(func: () => T, defaultValue: T): T; | ||
export declare function loadDir(dirPath: string, files?: string[]): string[]; | ||
export declare function loadDir(dirPath: string): string[]; |
@@ -88,3 +88,4 @@ "use strict"; | ||
} | ||
function loadDir(dirPath, files = []) { | ||
function loadDir(dirPath) { | ||
const files = []; | ||
const dirStat = fs.statSync(dirPath); | ||
@@ -101,3 +102,3 @@ if (dirStat.isFile()) { | ||
if (stat.isDirectory()) { | ||
loadDir(fullPath, files); | ||
files.push(...loadDir(fullPath)); | ||
} | ||
@@ -110,4 +111,4 @@ else if (stat.isFile()) { | ||
} | ||
return files; | ||
return Array.from(new Set(files)); | ||
} | ||
exports.loadDir = loadDir; |
{ | ||
"name": "egg-controller", | ||
"version": "0.1.14", | ||
"version": "0.1.15", | ||
"description": "controller for egg.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42524
996