How to use the node-titanium-sdk.availablePlatforms function in node-titanium-sdk

To help you get started, we’ve selected a few node-titanium-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appcelerator / titanium_mobile / cli / commands / project.js View on Github external
logger.error(__('%s is not a valid entry name', key) + '\n');
				}
				process.exit(1);
			}
			break;

		case 2:
			key = args[0];
			switch (key) {
				case 'deployment-targets':

					// Get list of platforms from ti manifest and set to false (default value)
					result = {};

					// add ipad and blackberry to list of platforms
					[ 'ipad', 'blackberry' ].concat(ti.availablePlatforms).forEach(function (p) {
						result[p] = false;
					});

					// Validate the platforms and override the tiapp.xml setting to true
					value = args[1].split(',');
					value.forEach(function (p) {
						if (!Object.prototype.hasOwnProperty.call(result, p)) {
							logger.error(__('Unsupported deployment target "%s"', p) + '\n');
							logger.log(__('Available deployment targets are:'));
							Object.keys(result).sort().forEach(function (p) {
								logger.log('    ' + p.cyan);
							});
							logger.log();
							process.exit(1);
						}
					});
github appcelerator / titanium_mobile / cli / commands / build.js View on Github external
validator: function (platform) {
									if (!platform) {
										throw new Error(__('Invalid platform'));
									} else if (ti.availablePlatforms.indexOf(platform) === -1) {
										throw new Error(__('Invalid platform: %s', platform));
									}
									return true;
								}
							},