@@ -18,6 +18,8 @@ var util = require('util'),
1818 frame = require ( './frame' ) ,
1919 user = require ( './user' ) ,
2020 rest = require ( './rest' ) ,
21+ Spinner = require ( 'cli-spinner' ) . Spinner ,
22+ spinner = new Spinner ( '[%s]' ) ,
2123
2224 // --> EXPORT
2325 fc = module . exports = { } ;
@@ -37,6 +39,10 @@ util.inherits(fc, EventEmitter);
3739fc . init = function ( ) {
3840 debug ( 'init' ) ;
3941
42+ console . log ( '\n' ) ;
43+ spinner . setSpinnerString ( 1 ) ;
44+ spinner . start ( ) ;
45+
4046 this . login ( )
4147 . then ( this . connect )
4248 . then ( this . ready )
@@ -79,7 +85,6 @@ fc.installPlugin = function(plugin) {
7985 } )
8086 . catch ( function ( err ) {
8187 if ( err . status === 404 ) {
82- console . log ( '\n' ) ;
8388 console . log ( '[o] ERROR: This frame has been set up perviously, but is not attached this user.' ) ;
8489 console . log ( '\n' ) ;
8590 console . log ( 'To reset the frame entirely, restart using: openframe -r' ) ;
@@ -123,7 +128,6 @@ fc.uninstallPlugin = function(packageName) {
123128 } )
124129 . catch ( function ( err ) {
125130 if ( err . status === 404 ) {
126- console . log ( '\n' ) ;
127131 console . log ( '[o] ERROR: This frame has been set up perviously, but is not attached this user.' ) ;
128132 console . log ( '\n' ) ;
129133 console . log ( 'To reset the frame entirely, restart using: openframe -r' ) ;
@@ -137,6 +141,7 @@ fc.uninstallPlugin = function(packageName) {
137141 */
138142fc . ready = function ( ) {
139143 debug ( 'ready' ) ;
144+ spinner . stop ( true ) ;
140145
141146 if ( frame . state && frame . state . _current_artwork ) {
142147 fc . changeArtwork ( ) ;
@@ -145,8 +150,8 @@ fc.ready = function() {
145150 var url_port = config . ofrc . network . api_url . split ( ':' ) ;
146151 var url = url_port [ 2 ] === '80' ? url_port [ 0 ] + url_port [ 1 ] : config . ofrc . network . api_url ;
147152
153+
148154 // No current artwork... give the user a message:
149- console . log ( '\n' ) ;
150155 console . log ( '[o] Frame connected!' ) ;
151156 console . log ( '\n' ) ;
152157 console . log ( 'This frame should now appear as ' + frame . state . name + ' when you log in to Openframe at ' + url + '.' ) ;
0 commit comments