phonegap-build
Advanced tools
Comparing version
@@ -5,3 +5,3 @@ # How to Contribute | ||
$ git clone https://github.com/mwbrooks/node-phonegap-build.git | ||
$ git clone https://github.com/phonegap/node-phonegap-build.git | ||
$ cd node-phonegap-build/ | ||
@@ -8,0 +8,0 @@ |
@@ -32,2 +32,3 @@ /* | ||
var paths = { | ||
root: process.cwd(), | ||
www: path.join(process.cwd(), 'www'), | ||
@@ -37,4 +38,10 @@ build: path.join(process.cwd(), 'build') | ||
// find the config.xml path | ||
var configPath = path.join(paths.root, 'config.xml'); | ||
if (!path.existsSync(configPath)) { | ||
configPath = path.join(paths.www, 'config.xml'); | ||
} | ||
// app name | ||
fs.readFile(path.join(paths.www, 'config.xml'), 'utf8', function(e, data) { | ||
fs.readFile(configPath, 'utf8', function(e, data) { | ||
if (e) { | ||
@@ -41,0 +48,0 @@ callback(e); |
{ | ||
"name": "phonegap-build", | ||
"description": "PhoneGap Build node library.", | ||
"version": "0.8.4", | ||
"homepage": "http://github.com/mwbrooks/node-phonegap-build", | ||
"version": "0.9.0", | ||
"homepage": "http://github.com/phonegap/node-phonegap-build", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/mwbrooks/node-phonegap-build.git" | ||
"url": "git://github.com/phonegap/node-phonegap-build.git" | ||
}, | ||
@@ -10,0 +10,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
# PhoneGap Build Node Library [![Build Status][travis-ci-img]][travis-ci-url] | ||
# PhoneGap Build Node Module [![Build Status][travis-ci-img]][travis-ci-url] | ||
@@ -183,8 +183,4 @@ > Node module to create and build PhoneGap projects with PhoneGap Build. | ||
## Related Projects | ||
[travis-ci-img]: https://travis-ci.org/phonegap/node-phonegap-build.png?branch=master | ||
[travis-ci-url]: https://travis-ci.org/phonegap/node-phonegap-build | ||
- [phonegap-cli](https://github.com/mwbrooks/phonegap-cli) | ||
[travis-ci-img]: https://travis-ci.org/mwbrooks/node-phonegap-build.png?branch=master | ||
[travis-ci-url]: https://travis-ci.org/mwbrooks/node-phonegap-build | ||
@@ -78,6 +78,22 @@ /* | ||
it('should try to read app name', function() { | ||
create(options, function(e, data) {}); | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).toMatch(/config\.xml$/); | ||
describe('when reading config', function() { | ||
it('should try to open my-app/www/config.xml', function() { | ||
create(options, function(e, data) {}); | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).toMatch('www/config.xml'); | ||
}); | ||
it('should fallback to my-app/config.xml', function() { | ||
spyOn(path, 'existsSync').andReturn(true); | ||
create(options, function(e, data) {}); | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).not.toMatch('www/config.xml'); | ||
expect(fs.readFile.mostRecentCall.args[0]).toMatch('/config.xml'); | ||
}); | ||
it('should try to read app name', function() { | ||
create(options, function(e, data) {}); | ||
expect(fs.readFile).toHaveBeenCalled(); | ||
expect(fs.readFile.mostRecentCall.args[0]).toMatch(/config\.xml$/); | ||
}); | ||
}); | ||
@@ -84,0 +100,0 @@ |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1502914
0.07%5853
0.34%186
-2.11%