Skip to content

Commit

Permalink
feat: download components
Browse files Browse the repository at this point in the history
  • Loading branch information
lenconda committed Jun 15, 2021
1 parent a7f76d5 commit 6a9ec51
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/@dollie/core/lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { githubOrigin, gitlabOrigin } = require('@dollie/origins');
const { Volume } = require('memfs');
const { loadTemplate } = require('./loader');

function Generator(name, config) {
function Generator(name, config = {}) {
this.templateName = '';
this.templateOrigin = '';

Expand All @@ -21,7 +21,7 @@ function Generator(name, config) {
};

this.initialize = async function() {
const { customOrigins = [] } = config;
const { origins: customOrigins = [] } = config;
origins = origins.concat(customOrigins);
if (_.isString(name)) {
[this.templateName, this.templateOrigin = 'github'] = name.split(':');
Expand Down Expand Up @@ -56,13 +56,15 @@ function Generator(name, config) {
throw new ContextError(`origin \`${this.templateOrigin}\` url parsed with errors`);
}

return await loadTemplate(url, virtualVolume, {
const duration = await loadTemplate(url, virtualVolume, {
headers,
...({
timeout: 90000,
}),
...config.loader,
});

return duration;
};
}

Expand Down

0 comments on commit 6a9ec51

Please sign in to comment.