phonegap-build
Advanced tools
Comparing version 0.4.3 to 0.5.0
@@ -20,3 +20,3 @@ /*! | ||
var args = Array.prototype.slice.call(arguments); | ||
args.unshift('phonegap'.cyan + ''); | ||
args.unshift('[phonegap]'.cyan + ''); | ||
console.log.apply(this, args); | ||
@@ -37,3 +37,3 @@ }; | ||
var args = Array.prototype.slice.call(arguments); | ||
args.unshift('warning'.yellow + ' '); | ||
args.unshift('[warning]'.yellow + ' '); | ||
console.log.apply(this, args); | ||
@@ -54,3 +54,3 @@ }; | ||
var args = Array.prototype.slice.call(arguments); | ||
args.unshift('error'.red + ' '); | ||
args.unshift('[error]'.red + ' '); | ||
console.log.apply(this, args); | ||
@@ -73,3 +73,3 @@ }; | ||
prompt.colors = false; | ||
prompt.message = 'prompt'.green; | ||
prompt.message = '[prompt]'.green; | ||
prompt.delimiter = ' '; | ||
@@ -76,0 +76,0 @@ prompt.start(); |
@@ -5,3 +5,4 @@ /*! | ||
var console = require('./console'); | ||
var console = require('./console'), | ||
path = require('path'); | ||
@@ -40,3 +41,3 @@ /** | ||
else { | ||
console.log('created the project:', data.path); | ||
console.log('created the project:', path.relative('.', data.path)); | ||
} | ||
@@ -43,0 +44,0 @@ |
@@ -23,3 +23,3 @@ /** | ||
'', | ||
' Synopsis:', | ||
' Description:', | ||
'', | ||
@@ -26,0 +26,0 @@ ' PhoneGap Build command-line tool.', |
@@ -17,3 +17,3 @@ /** | ||
'', | ||
' Synopsis:', | ||
' Description:', | ||
'', | ||
@@ -20,0 +20,0 @@ ' Build your application to a specific platform.', |
@@ -17,3 +17,3 @@ /** | ||
'', | ||
' Synopsis:', | ||
' Description:', | ||
'', | ||
@@ -20,0 +20,0 @@ ' Create a new application.', |
@@ -17,3 +17,3 @@ /** | ||
'', | ||
' Synopsis:', | ||
' Description:', | ||
'', | ||
@@ -20,0 +20,0 @@ ' Log into your PhoneGap Build account.', |
@@ -19,3 +19,3 @@ /* | ||
process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], | ||
'.phonegap' | ||
'.cordova' | ||
); | ||
@@ -57,2 +57,3 @@ | ||
data = JSON.parse(data); | ||
data.phonegap = data.phonegap || {}; | ||
callback(null, data); | ||
@@ -63,3 +64,3 @@ }); | ||
// create config file | ||
var data = {}; | ||
var data = { phonegap: {} }; | ||
module.exports.save(data, function(e) { | ||
@@ -66,0 +67,0 @@ if (e) { |
@@ -61,3 +61,3 @@ /*! | ||
// log out by removing user auth token | ||
data.token = undefined; | ||
delete data.phonegap.token; | ||
config.global.save(data, function(e) { | ||
@@ -64,0 +64,0 @@ if (e) { |
{ | ||
"name": "phonegap-build", | ||
"description": "PhoneGap Build command-line interface and node.js library.", | ||
"version": "0.4.3", | ||
"version": "0.5.0", | ||
"homepage": "http://github.com/mwbrooks/phonegap-build-cli", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -106,5 +106,3 @@ # PhoneGap Build CLI [![Build Status][travis-ci-img]][travis-ci-url] | ||
- `options` {Object} is data required to create an app | ||
- `api` {Object} is a phonegap-build-rest API object. | ||
- `path` {String} is a directory path for the app. | ||
- `name` {String} is the app name give to PhoneGap Build. | ||
- [`callback`] {Function} is triggered after creating the app. | ||
@@ -121,3 +119,3 @@ - `e` {Error} is null unless there is an error. | ||
build.create({ api: api, path: 'path/to/new/app', name: 'My App' }, function(e) { | ||
build.create({ path: 'path/to/new/app' }, function(e) { | ||
}); | ||
@@ -151,4 +149,10 @@ | ||
## Related Projects | ||
- [phonegap-app-site](https://github.com/nitobi/phonegap-app-site) | ||
- [phonegap-app](https://github.com/mwbrooks/phonegap-app) | ||
- [phonegap-cli](https://github.com/mwbrooks/phonegap-cli) | ||
[travis-ci-img]: https://secure.travis-ci.org/mwbrooks/phonegap-build-cli.png | ||
[travis-ci-url]: http://travis-ci.org/mwbrooks/phonegap-build-cli | ||
@@ -56,3 +56,3 @@ /* | ||
spyOn(fs, 'readFile').andCallFake(function(filepath, callback) { | ||
callback(null, '{ "token": "abc123" }'); | ||
callback(null, '{ "phonegap" : { "token": "abc123" } }'); | ||
}); | ||
@@ -70,3 +70,3 @@ }); | ||
config.global.load(function(e, data) { | ||
expect(data).toEqual({ token: 'abc123' }); | ||
expect(data).toEqual({ phonegap: { token: 'abc123' } }); | ||
done(); | ||
@@ -122,3 +122,3 @@ }); | ||
config.global.load(function(e, data) {}); | ||
expect(config.global.save.mostRecentCall.args[0]).toEqual({}); | ||
expect(config.global.save.mostRecentCall.args[0]).toEqual({ phonegap: {} }); | ||
}); | ||
@@ -135,3 +135,3 @@ | ||
config.global.load(function(e, data) { | ||
expect(data).toEqual({}); | ||
expect(data).toEqual({ phonegap: {} }); | ||
done(); | ||
@@ -168,3 +168,3 @@ }); | ||
beforeEach(function() { | ||
data = { token: 'abc123' }; | ||
data = { phonegap: { token: 'abc123' } }; | ||
spyOn(shell, 'mkdir'); | ||
@@ -211,5 +211,5 @@ spyOn(fs, 'writeFile'); | ||
it('should write the json data', function(done) { | ||
config.global.save({ token: 'def456', username: 'link' }, function(e) { | ||
config.global.save({ phonegap: { token: 'def456', username: 'link' } }, function(e) { | ||
var data = JSON.parse(fs.writeFile.mostRecentCall.args[1]); | ||
expect(data).toEqual({ token: 'def456', username: 'link' }); | ||
expect(data).toEqual({ phonegap: { token: 'def456', username: 'link' } }); | ||
done(); | ||
@@ -220,3 +220,3 @@ }); | ||
it('should trigger callback without an error', function(done) { | ||
config.global.save({ token: 'def456' }, function(e) { | ||
config.global.save({ phonegap: { token: 'def456' } }, function(e) { | ||
expect(e).toBeNull(); | ||
@@ -236,3 +236,3 @@ done(); | ||
it('should trigger callback with an error', function(done) { | ||
config.global.save({ token: 'def456' }, function(e) { | ||
config.global.save({ phonegap: { token: 'def456' } }, function(e) { | ||
expect(e).toEqual(jasmine.any(Error)); | ||
@@ -239,0 +239,0 @@ done(); |
@@ -38,4 +38,6 @@ /* | ||
callback(null, { | ||
email: 'zelda@nintendo.com', | ||
token: 'abc123' | ||
phonegap: { | ||
email: 'zelda@nintendo.com', | ||
token: 'abc123' | ||
} | ||
}); | ||
@@ -63,3 +65,3 @@ }); | ||
process.nextTick(function() { | ||
expect(config.global.save.mostRecentCall.args[0].token).not.toBeDefined(); | ||
expect(config.global.save.mostRecentCall.args[0].phonegap.token).not.toBeDefined(); | ||
done(); | ||
@@ -73,3 +75,7 @@ }); | ||
expect(config.global.save.mostRecentCall.args[0]).toEqual( | ||
{ email: 'zelda@nintendo.com' } | ||
{ | ||
phonegap: { | ||
email: 'zelda@nintendo.com' | ||
} | ||
} | ||
); | ||
@@ -76,0 +82,0 @@ done(); |
1538276
7011
156