Skip to content

Commit

Permalink
Merge pull request #49 from appcelerator/timob-13634
Browse files Browse the repository at this point in the history
[TIMOB-13634] Fixed bug with Android SDK add-ons with missing manifest.ini files to crash the CLI.
  • Loading branch information
nebrius committed Jun 5, 2013
2 parents 84ab751 + efb59d0 commit 58c6af7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Added check to see if session file is writable when logging in or out of Appc network [TIMOB-13908]
* Improved AppcException to include a toString() function and improved dump() function
* Added isFileWritable() function to fs library
* Fixed bug with Android SDK add-ons with missing manifest.ini files to crash the CLI [TIMOB-13634]

0.1.30
-------------------
Expand Down
19 changes: 11 additions & 8 deletions lib/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,17 @@ exports.detect = function (finished, sdkPath, ndkPath) {

// Create the list of target directories and their properties
afs.visitDirsSync(path.join(sdkPath, 'add-ons'), function(subDir, subDirPath) {
var manifest = fs.readFileSync(path.join(subDirPath, 'manifest.ini')).toString();
targetDirs.push({
dirPath: subDirPath,
name: manifest.match(manifestNameRegex)[1],
vendor: manifest.match(manifestVendorRegex)[1],
api: manifest.match(manifestApiRegex)[1],
revision: manifest.match(manifestRevisionRegex)[1]
});
var manifestFile = path.join(subDirPath, 'manifest.ini');
if (afs.exists(manifestFile)) {
var manifest = fs.readFileSync(manifestFile).toString();
targetDirs.push({
dirPath: subDirPath,
name: manifest.match(manifestNameRegex)[1],
vendor: manifest.match(manifestVendorRegex)[1],
api: manifest.match(manifestApiRegex)[1],
revision: manifest.match(manifestRevisionRegex)[1]
});
}
});

// Find the paths for the target and remove unsupported android versions
Expand Down

0 comments on commit 58c6af7

Please sign in to comment.