How to use the node-titanium-sdk.validateProjectDir 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
exports.validate = function (logger, config, cli) {
	ti.validateProjectDir(logger, cli, cli.argv, 'project-dir');

	// Validate the key, if it exists
	if (cli.argv._.length > 0) {
		const key = cli.argv._[0];
		if (!/^([A-Za-z_]{1}[A-Za-z0-9-_]*(\.[A-Za-z-_]{1}[A-Za-z0-9-_]*)*)$/.test(key)) {
			logger.error(__('Invalid key "%s"', key) + '\n');
			process.exit(1);
		}
	}

	return function (finished) {
		ti.loadPlugins(null, config, cli, cli.argv['project-dir'], finished, cli.argv.output !== 'report' || cli.argv._.length, false);
	};
};
github appcelerator / titanium_mobile / cli / commands / clean.js View on Github external
if (platforms.bad.length) {
				logger.error(__n('Invalid platform: %%s', 'Invalid platforms: %%s', platforms.bad.length, platforms.bad.join(', ')) + '\n');
				logger.log(__('Available platforms for SDK version %s:', ti.manifest.sdkVersion) + '\n');
				ti.targetPlatforms.forEach(function (p) {
					logger.log('    ' + p.cyan);
				});
				logger.log();
				process.exit(1);
			}

			cli.argv.platforms = platforms.scrubbed;
		} else {
			cli.argv.platforms = null;
		}

		ti.validateProjectDir(logger, cli, cli.argv, 'project-dir');

		return function (finished) {
			ti.loadPlugins(logger, config, cli, cli.argv['project-dir'], function () {
				finished();
			});
		};
	}
};