Skip to content

Commit

Permalink
Merge pull request #3305 from cb1kenobi/timob-11531
Browse files Browse the repository at this point in the history
[TIMOB-11531] Fixed but with commonjs modules not having the correct rou...
  • Loading branch information
cb1kenobi committed Oct 19, 2012
2 parents 7cd1f1f + 013eafe commit ab2b280
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
20 changes: 12 additions & 8 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ exports.config = function (logger, config, cli) {
desc: __('the provisioning profile uuid; required when target is %s, %s, or %s', 'device'.cyan, 'dist-appstore'.cyan, 'dist-adhoc'.cyan),
hint: 'uuid',
prompt: {
label: __('Provisioning profile UUID'),
error: __('Invalid provisioning profile UUID'),
label: __('Provisioning Profile UUID'),
error: __('Invalid Provisioning Profile UUID'),
validator: function (uuid) {
var i = 0,
j,
Expand All @@ -208,7 +208,11 @@ exports.config = function (logger, config, cli) {
availableUUIDs.push(' ' + profiles[i].uuid.cyan + ' ' + profiles[i].appId + ' (' + profiles[i].name + ')');
}

throw new appc.exception(__('Unable to find a Provisioning Profile UUID "%s"', uuid), availableUUIDs);
if (uuid) {
throw new appc.exception(__('Unable to find a Provisioning Profile UUID "%s"', uuid), availableUUIDs);
} else {
throw new appc.exception(__('Please specify a Provisioning Profile UUID'), availableUUIDs);
}
}
}
},
Expand Down Expand Up @@ -2061,7 +2065,7 @@ build.prototype = {
this.commonJsModules.forEach(function (m) {
var file = path.join(m.modulePath, m.id + '.js');
if (afs.exists(file)) {
var id = 'modules/' + m.id.replace(/\./g, '_') + '_js';
var id = m.id.replace(/\./g, '_') + '_js';
this.compileJsFile(id, file);
this.jsFilesToPrepare.push(id);
}
Expand All @@ -2076,7 +2080,7 @@ build.prototype = {

this.cli.fireHook('build.prerouting', this, function (err) {
var args = [path.join(this.titaniumIosSdkPath, 'titanium_prep'), this.tiapp.id, this.assetsDir],
out = '',
out = [],
child;

this.logger.info(__('Running titanium_prep: %s', args.join(' ').cyan));
Expand All @@ -2088,10 +2092,10 @@ build.prototype = {
child.stdin.write(this.jsFilesToPrepare.join('\n'));
child.stdin.end();
child.stdout.on('data', function (data) {
out += data.toString();
out.push(data.toString());
});
child.stderr.on('data', function (data) {
out += data.toString();
out.push(data.toString());
});
child.on('exit', function (code) {
if (code) {
Expand Down Expand Up @@ -2147,7 +2151,7 @@ build.prototype = {
'',
'+ (NSData*) resolveAppAsset:(NSString*)path;',
'{',
out,
out.join(''),
' NSNumber *index = [map objectForKey:path];',
' if (index == nil) { return nil; }',
' return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[index.integerValue]);',
Expand Down
1 change: 0 additions & 1 deletion support/cli/commands/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ exports.validate = function (logger, config, cli) {
};

exports.run = function (logger, config, cli) {

var projectDir = cli.argv['project-dir'],
tiappPath = path.join(projectDir, 'tiapp.xml'),
tiapp = new ti.tiappxml(tiappPath),
Expand Down

0 comments on commit ab2b280

Please sign in to comment.