fix(dependencies): resolve dependencies

This commit is contained in:
2018-08-28 00:20:02 +02:00
parent f3594447ac
commit aa87ed9427
3 changed files with 21 additions and 1 deletions

View File

@@ -19,6 +19,8 @@ export class ScafTemplate {
suppliedVariables: any = {};
missingVariables: string[] = [];
dependencies: ScafTemplate[];
/**
* read a template from a directory
*/
@@ -28,6 +30,7 @@ export class ScafTemplate {
await this._findVariablesInTemplate();
await this._checkSuppliedVariables();
await this._checkDefaultVariables();
await this._resolveTemplateDependencies();
}
/**
@@ -153,4 +156,19 @@ export class ScafTemplate {
this.defaultVariables = {};
}
}
/**
* resolve template dependencies
*/
private async _resolveTemplateDependencies() {
const dependencies = this.templateSmartfileArray.find(smartfileArg => {
return smartfileArg.parsedPath.base === "dependencies.yml"
});
if(!dependencies) {
console.log('No further template dependencies defined!');
return;
}
console.log('Found template dependencies! Resolving them now!')
}
}