@@ -26,12 +26,14 @@ import { vsCommand, VsCommandError } from '../vscommand';
2626import { SourceType } from '../odo/config' ;
2727import { ComponentKind , ComponentTypeAdapter } from '../odo/componentType' ;
2828import { Url } from '../odo/url' ;
29+ import { ComponentDescription , StarterProjectDescription } from '../odo/catalog' ;
2930
3031import path = require( 'path' ) ;
3132import globby = require( 'globby' ) ;
3233import treeKill = require( 'tree-kill' ) ;
3334import fs = require( 'fs-extra' ) ;
3435
36+
3537const waitPort = require ( 'wait-port' ) ;
3638
3739export class SourceTypeChoice {
@@ -606,8 +608,12 @@ export class Component extends OpenShiftItem {
606608 const globbyPath = `${ folder . fsPath . replace ( '\\' , '/' ) } /` ;
607609 const paths = globby . sync ( `${ globbyPath } *` , { dot : true , onlyFiles : false } ) ;
608610 if ( paths . length === 0 ) {
609- const create = await window . showQuickPick ( [ 'Yes' , 'No' ] , { placeHolder : 'Initialize Component using default Starter Project?' } ) ;
610- createStarter = create === 'Yes' ;
611+ const descr = await this . odo . execute ( Command . describeCatalogComponent ( componentType . name ) ) ;
612+ const starterProjects : StarterProjectDescription [ ] = this . odo . loadItems < StarterProjectDescription > ( descr , ( data :{ Data :ComponentDescription } ) => data . Data . starterProjects ) ;
613+ if ( starterProjects ?. length && starterProjects ?. length > 0 ) {
614+ const create = await window . showQuickPick ( [ 'Yes' , 'No' ] , { placeHolder : 'Initialize Component using default Starter Project?' } ) ;
615+ createStarter = create === 'Yes' ;
616+ }
611617 }
612618 }
613619 }
0 commit comments