phonegap-build
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -59,3 +59,3 @@ /*! | ||
// no config or token key | ||
if (e || !data.token) { | ||
if (e || !data.phonegap || !data.phonegap.token) { | ||
// require options | ||
@@ -86,4 +86,9 @@ if (!options) { | ||
// save token to config | ||
config.global.save({ 'token': api.token }, function(e) { | ||
// data | ||
data = data || {}; | ||
data.phonegap = data.phonegap || {}; | ||
data.phonegap.token = api.token; | ||
// save the data | ||
config.global.save(data, function(e) { | ||
// do not provide api on error | ||
@@ -106,3 +111,3 @@ if (e) { | ||
'path': '/api/v1', | ||
'token': data.token | ||
'token': data.phonegap.token | ||
}); | ||
@@ -109,0 +114,0 @@ |
{ | ||
"name": "phonegap-build", | ||
"description": "PhoneGap Build command-line interface and node.js library.", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"homepage": "http://github.com/mwbrooks/phonegap-build-cli", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -38,3 +38,8 @@ /* | ||
config.global.load.andCallFake(function(callback) { | ||
callback(null, { 'email': 'zelda@hyrule.org', 'token': 'abc123' }); | ||
callback(null, { | ||
'phonegap': { | ||
'email': 'zelda@hyrule.org', | ||
'token': 'abc123' | ||
} | ||
}); | ||
}); | ||
@@ -69,3 +74,3 @@ }); | ||
config.global.load.andCallFake(function(callback) { | ||
callback(new Error('config not found at ~/.phonegap-build')); | ||
callback(new Error('config not found at ~/.cordova')); | ||
}); | ||
@@ -105,3 +110,3 @@ }); | ||
client.auth.andCallFake(function(options, callback) { | ||
callback(null, {}); | ||
callback(null, { token: 'abc123' }); | ||
}); | ||
@@ -114,2 +119,5 @@ }); | ||
expect(config.global.save).toHaveBeenCalled(); | ||
expect( | ||
config.global.save.mostRecentCall.args[0].phonegap.token | ||
).toEqual('abc123'); | ||
}); | ||
@@ -116,0 +124,0 @@ }); |
1539280
7031