lib/index.js
function(filename, fileInfo) {
		var projectName = path.relative(
			app.config.paths.projects,
			path.dirname(filename)
		);

		if (app.projects.get(projectName)) {
			logger.log('Unload project: "' + projectName + '"');
			app.projects.unload({name: projectName});
		}

		// on add or change (info is falsy on unlink)
		if (fileInfo) {
			logger.log('Load project "' + projectName + '" on change');
			app.projects.load({name: projectName}, function(err) {
				if (err) {
					return logger.error(
						'Error during load project "' + projectName + '": ',
						err.stack || err
					);
				}
				logger.log(
					'Project "' + projectName + '" loaded:',
					JSON.stringify(app.projects.get(projectName), null, 4)
				);
			});
		}
	}
function(filename, fileInfo) {
		var projectName = path.relative(
			app.config.paths.projects,
			path.dirname(filename)
		);

		if (app.projects.get(projectName)) {
			logger.log('Unload project: "' + projectName + '"');
			app.projects.unload({name: projectName});
		}

		// on add or change (info is falsy on unlink)
		if (fileInfo) {
			logger.log('Load project "' + projectName + '" on change');
			app.projects.load({name: projectName}, function(err) {
				if (err) {
					return logger.error(
						'Error during load project "' + projectName + '": ',
						err.stack || err
					);
				}
				logger.log(
					'Project "' + projectName + '" loaded:',
					JSON.stringify(app.projects.get(projectName), null, 4)
				);
			});
		}
	}
function ( filename , fileInfo ) { var projectName = path . relative ( app . config . paths . projects , path . dirname ( filename ) ) ; if ( app . projects . get ( projectName ) ) { logger . log ( 'Unload project: "' + projectName + '"' ) ; app . projects . unload ( { name : projectName } ) ; } // on add or change (info is falsy on unlink) if ( fileInfo ) { logger . log ( 'Load project "' + projectName + '" on change' ) ; app . projects . load ( { name : projectName } , function ( err ) { if ( err ) { return logger . error ( 'Error during load project "' + projectName + '": ' , err . stack || err ) ; } logger . log ( 'Project "' + projectName + '" loaded:' , JSON . stringify ( app . projects . get ( projectName ) , null , 4 ) ) ; } ) ; } }
start file watcher for reloading projects on change
start file watcher for reloading projects on change