How to use the node-titanium-sdk.validateAppJsExists 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 / mobileweb / cli / commands / _build.js View on Github external
MobileWebBuilder.prototype.createBuildDirs = function createBuildDirs(next) {
	// Make sure we have an app.js. This used to be validated in validate(), but since plugins like
	// Alloy generate an app.js, it may not have existed during validate(), but should exist now
	// that build.pre.compile was fired.
	ti.validateAppJsExists(this.projectDir, this.logger, 'mobileweb');

	if (fs.existsSync(this.buildDir)) {
		this.logger.debug(__('Deleting existing build directory'));
		try {
			wrench.rmdirSyncRecursive(this.buildDir);
		} catch (e) {
			this.logger.error(__('Failed to remove build directory: %s', this.buildDir));
			if (e.message.indexOf('resource busy or locked') != -1) {
				this.logger.error(__('Build directory is busy or locked'));
				this.logger.error(__('Check that you don\'t have any terminal sessions or programs with open files in the build directory') + '\n');
			} else {
				this.logger.error(e.message + '\n');
			}
			process.exit(1);
		}
	}
github appcelerator / titanium_mobile_windows / cli / commands / _build / checks.js View on Github external
function checkAppJs(next) {
	// Make sure we have an app.js. This used to be validated in validate(), but since plugins like
	// Alloy generate an app.js, it may not have existed during validate(), but should exist now
	// that build.pre.compile was fired.
	ti.validateAppJsExists(this.projectDir, this.logger, 'windows');

	next();
}