hooks/before_prepare/icon.js
function loadProjectName(callback) {
	try {
		var contents = fs.readFileSync(path.join(__dirname, '../../config.xml'), 'utf-8');
		if (contents) {
			// Windows is the BOM. Skip the Byte Order Mark.
			contents = contents.substring(contents.indexOf('<'));
		}

		var doc = new et.ElementTree(et.XML(contents));
		var root = doc.getroot();

		if (root.tag !== 'widget') {
			throw new Error('config.xml has incorrect root node name (expected "widget", was "' + root.tag + '")');
		}

		var tag = root.find('./name');

		if (!tag) {
			throw new Error('config.xml has no name tag.');
		}

		return tag.text;
	} catch (e) {
		console.error('Could not loading config.xml');
		throw e;
	}
}
function loadProjectName(callback) {
	try {
		var contents = fs.readFileSync(path.join(__dirname, '../../config.xml'), 'utf-8');
		if (contents) {
			// Windows is the BOM. Skip the Byte Order Mark.
			contents = contents.substring(contents.indexOf('<'));
		}

		var doc = new et.ElementTree(et.XML(contents));
		var root = doc.getroot();

		if (root.tag !== 'widget') {
			throw new Error('config.xml has incorrect root node name (expected "widget", was "' + root.tag + '")');
		}

		var tag = root.find('./name');

		if (!tag) {
			throw new Error('config.xml has no name tag.');
		}

		return tag.text;
	} catch (e) {
		console.error('Could not loading config.xml');
		throw e;
	}
}
function loadProjectName ( callback ) { try { var contents = fs . readFileSync ( path . join ( __dirname , '../../config.xml' ) , 'utf-8' ) ; if ( contents ) { // Windows is the BOM. Skip the Byte Order Mark. contents = contents . substring ( contents . indexOf ( '<' ) ) ; } var doc = new et . ElementTree ( et . XML ( contents ) ) ; var root = doc . getroot ( ) ; if ( root . tag !== 'widget' ) { throw new Error ( 'config.xml has incorrect root node name (expected "widget", was "' + root . tag + '")' ) ; } var tag = root . find ( './name' ) ; if ( ! tag ) { throw new Error ( 'config.xml has no name tag.' ) ; } return tag . text ; } catch ( e ) { console . error ( 'Could not loading config.xml' ) ; throw e ; } }
Loads the project name from the config.xml file.

@param {Function} callback Called when the name is retrieved.
Loads the project name from the config . xml file .