@@ -22,9 +22,9 @@ IonicTask.WRAPPER_REPO_NAME = 'ionic-app-base';
2222
2323IonicTask . DEFAULT_APP = {
2424 "plugins" : [
25- "org.apache.cordova.device@0.2.12 " ,
26- "org.apache.cordova.console@0.2.11 " ,
27- "com.ionic.keyboard@1.0.3 "
25+ "org.apache.cordova.device" ,
26+ "org.apache.cordova.console" ,
27+ "com.ionic.keyboard"
2828 ] ,
2929 "sass" : false
3030} ;
@@ -167,6 +167,11 @@ IonicTask.prototype.fetchSeed = function() {
167167 return this . fetchCodepen ( ) ;
168168 }
169169
170+ if ( / c r e a t o r : / i. test ( this . template ) ) {
171+ this . seedType = 'creator' ;
172+ return this . fetchCreatorApp ( ) ;
173+ }
174+
170175 // Github URL: http://github.com/myrepo/
171176 if ( / \/ \/ g i t h u b .c o m \/ / i. test ( this . template ) ) {
172177 this . seedType = 'github' ;
@@ -205,6 +210,32 @@ IonicTask.prototype.loadAppSetup = function() {
205210} ;
206211
207212
213+ IonicTask . prototype . fetchCreatorApp = function ( ) {
214+ var self = this ;
215+ var appId = this . template . split ( ':' ) [ 1 ] ;
216+ var downloadUrl = Ionic . IONIC_DASH + path . join ( '/api/v1/creator' , appId , 'download/html' ) ;
217+ var wwwPath = path . join ( this . targetPath , 'www' ) ;
218+
219+ console . log ( '\nDownloading Creator Prototype:' . bold , downloadUrl ) ;
220+
221+ var q = Q . defer ( ) ;
222+
223+ var proxy = process . env . PROXY || null ;
224+
225+ request ( { url : downloadUrl , proxy : proxy } , function ( err , res , html ) {
226+ if ( ! err && res && res . statusCode === 200 ) {
227+ //html = self.convertTemplates(html);
228+
229+ fs . writeFileSync ( path . join ( wwwPath , 'index.html' ) , html , 'utf8' ) ;
230+ } else {
231+ console . log ( 'Unable to fetch' , err , res . statusCode ) ;
232+ q . reject ( res ) ;
233+ }
234+ q . resolve ( ) ;
235+ } ) ;
236+ return Q . all ( [ q ] ) ;
237+ } ;
238+
208239IonicTask . prototype . fetchCodepen = function ( ) {
209240 var self = this ;
210241 var codepenUrl = this . template . split ( '?' ) [ 0 ] . split ( '#' ) [ 0 ] ;
0 commit comments