File tree Expand file tree Collapse file tree 2 files changed +2
-31
lines changed Expand file tree Collapse file tree 2 files changed +2
-31
lines changed Original file line number Diff line number Diff line change @@ -223,21 +223,7 @@ const initFunction = async () => {
223
223
fs.mkdirSync(templatesDir, "777");
224
224
const repo = "https://github.com/{{ sdk .gitUserName }}/templates";
225
225
const api = `https://api.github.com/repos/{{ sdk .gitUserName }}/templates/contents/${answers.runtime.name}`
226
- let selected = undefined;
227
-
228
- if(answers.template === 'starter') {
229
- selected = { template: 'starter' };
230
- } else {
231
- try {
232
- const res = await fetch(api);
233
- const templates = [];
234
- templates.push(...(await res.json()).map((template) => template.name));
235
- selected = await inquirer.prompt(questionsCreateFunctionSelectTemplate(templates));
236
- } catch {
237
- // Not a problem will go with directory pulling
238
- log('Loading templates...');
239
- }
240
- }
226
+ let selected = { template: 'starter' };
241
227
242
228
const sparse = (selected ? `${answers.runtime.name}/${selected.template}` : answers.runtime.name).toLowerCase();
243
229
Original file line number Diff line number Diff line change @@ -301,22 +301,7 @@ const questionsCreateFunction = [
301
301
})
302
302
return choices;
303
303
},
304
- },
305
- {
306
- type: "list",
307
- name: "template",
308
- message: "How would you like to start your function code?",
309
- choices: [
310
- {
311
- name: `Start from scratch ${chalk.blackBright(`(starter)`)}`,
312
- value: "starter"
313
- },
314
- {
315
- name: "Pick a template",
316
- value: "custom"
317
- }
318
- ]
319
- },
304
+ }
320
305
];
321
306
322
307
const questionsCreateFunctionSelectTemplate = (templates) => {
You can’t perform that action at this time.
0 commit comments