Add information on how to login on user permission error

This commit is contained in:
Juan Cruz Viotti 2016-01-21 23:07:08 -04:00
parent de0649c980
commit a346c3f043
2 changed files with 8 additions and 2 deletions

View File

@ -37,7 +37,7 @@ limitations under the License.
capitano.permission('user', function(done) {
return resin.auth.isLoggedIn().then(function(isLoggedIn) {
if (!isLoggedIn) {
throw new Error('You have to log in');
throw new Error('You have to log in to continue\n\nRun the following command to go through the login wizard:\n\n $ resin login');
}
}).nodeify(done);
});

View File

@ -26,7 +26,13 @@ update = require('./utils/update')
capitano.permission 'user', (done) ->
resin.auth.isLoggedIn().then (isLoggedIn) ->
if not isLoggedIn
throw new Error ('You have to log in')
throw new Error '''
You have to log in to continue
Run the following command to go through the login wizard:
$ resin login
'''
.nodeify(done)
capitano.command