lib/configure.js
function configurePaths(cfg) {
	var sourcesBasePath = path.resolve(appPath, cfg.get('sourcesBasePath'))
	   ,sources = cfg.get('sources')
	   ,build = cfg.get('build')
	   ,buildBaseUri
	   ,buildDir = nodeEnv == 'development' ? build.baseDirNameDev : build.baseDirNameDist
	   ,buildPath = path.join( path.resolve(appPath, cfg.get('buildBasePath')), buildDir)
	   ,keys, key
	   ,i
	;

	buildBaseUri = cfg.get('staticBaseUri') + '/' + buildDir +'/';
	cfg.set('buildBaseUri', buildBaseUri);
	cfg.set('cssUri', buildBaseUri + build.css.dirName + build.css.external[nodeEnv]);
	cfg.set('jsUri', buildBaseUri + build.js.dirName + build.js.external[nodeEnv]);
	cfg.set('testUri', buildBaseUri + build.js.dirName + 'test.js');

	// Resolve absolute paths from relative paths in config files

	cfg.set('staticPath',            path.resolve(appPath, cfg.get('staticPath')));
	cfg.set('routesPath',            path.resolve(appPath, cfg.get('routesPath')));
	cfg.set('buildBasePath',         path.resolve(appPath, cfg.get('buildBasePath')));
	cfg.set('helpersPath',           path.resolve(appPath, cfg.get('helpersPath')));
	cfg.set('handlebarsHelpersPath', path.resolve(appPath, cfg.get('handlebarsHelpersPath')));

	cfg.set('repoWebViewBaseUri', cfg.get('repository').replace('.git', '/') );

	keys = Object.keys(sources);
	for (i = 0; i < keys.length; i++) {
		key = keys[i];
		cfg.set( 'sources.'+key, path.resolve( sourcesBasePath, sources[key]) );
	}

	build.css.inline[nodeEnv] &&
		cfg.set('build.css.inline',   path.resolve( buildPath, build.css.inline[nodeEnv] ));

	build.css.external[nodeEnv] &&
		cfg.set('build.css.external', path.resolve( buildPath, build.css.external[nodeEnv] ));

	build.js.inline[nodeEnv] &&
		cfg.set('build.js.inline',    path.resolve( buildPath, build.js.inline[nodeEnv] ));

	build.js.external[nodeEnv] &&
		cfg.set('build.js.external',  path.resolve( buildPath, build.js.external[nodeEnv] ));

	cfg.set('build.spritesheets', path.resolve( buildPath, build.spriteSheets.dirName ));

	return cfg;
}
function configurePaths(cfg) {
	var sourcesBasePath = path.resolve(appPath, cfg.get('sourcesBasePath'))
	   ,sources = cfg.get('sources')
	   ,build = cfg.get('build')
	   ,buildBaseUri
	   ,buildDir = nodeEnv == 'development' ? build.baseDirNameDev : build.baseDirNameDist
	   ,buildPath = path.join( path.resolve(appPath, cfg.get('buildBasePath')), buildDir)
	   ,keys, key
	   ,i
	;

	buildBaseUri = cfg.get('staticBaseUri') + '/' + buildDir +'/';
	cfg.set('buildBaseUri', buildBaseUri);
	cfg.set('cssUri', buildBaseUri + build.css.dirName + build.css.external[nodeEnv]);
	cfg.set('jsUri', buildBaseUri + build.js.dirName + build.js.external[nodeEnv]);
	cfg.set('testUri', buildBaseUri + build.js.dirName + 'test.js');

	// Resolve absolute paths from relative paths in config files

	cfg.set('staticPath',            path.resolve(appPath, cfg.get('staticPath')));
	cfg.set('routesPath',            path.resolve(appPath, cfg.get('routesPath')));
	cfg.set('buildBasePath',         path.resolve(appPath, cfg.get('buildBasePath')));
	cfg.set('helpersPath',           path.resolve(appPath, cfg.get('helpersPath')));
	cfg.set('handlebarsHelpersPath', path.resolve(appPath, cfg.get('handlebarsHelpersPath')));

	cfg.set('repoWebViewBaseUri', cfg.get('repository').replace('.git', '/') );

	keys = Object.keys(sources);
	for (i = 0; i < keys.length; i++) {
		key = keys[i];
		cfg.set( 'sources.'+key, path.resolve( sourcesBasePath, sources[key]) );
	}

	build.css.inline[nodeEnv] &&
		cfg.set('build.css.inline',   path.resolve( buildPath, build.css.inline[nodeEnv] ));

	build.css.external[nodeEnv] &&
		cfg.set('build.css.external', path.resolve( buildPath, build.css.external[nodeEnv] ));

	build.js.inline[nodeEnv] &&
		cfg.set('build.js.inline',    path.resolve( buildPath, build.js.inline[nodeEnv] ));

	build.js.external[nodeEnv] &&
		cfg.set('build.js.external',  path.resolve( buildPath, build.js.external[nodeEnv] ));

	cfg.set('build.spritesheets', path.resolve( buildPath, build.spriteSheets.dirName ));

	return cfg;
}
function configurePaths ( cfg ) { var sourcesBasePath = path . resolve ( appPath , cfg . get ( 'sourcesBasePath' ) ) , sources = cfg . get ( 'sources' ) , build = cfg . get ( 'build' ) , buildBaseUri , buildDir = nodeEnv == 'development' ? build . baseDirNameDev : build . baseDirNameDist , buildPath = path . join ( path . resolve ( appPath , cfg . get ( 'buildBasePath' ) ) , buildDir ) , keys , key , i ; buildBaseUri = cfg . get ( 'staticBaseUri' ) + '/' + buildDir + '/' ; cfg . set ( 'buildBaseUri' , buildBaseUri ) ; cfg . set ( 'cssUri' , buildBaseUri + build . css . dirName + build . css . external [ nodeEnv ] ) ; cfg . set ( 'jsUri' , buildBaseUri + build . js . dirName + build . js . external [ nodeEnv ] ) ; cfg . set ( 'testUri' , buildBaseUri + build . js . dirName + 'test.js' ) ; // Resolve absolute paths from relative paths in config files cfg . set ( 'staticPath' , path . resolve ( appPath , cfg . get ( 'staticPath' ) ) ) ; cfg . set ( 'routesPath' , path . resolve ( appPath , cfg . get ( 'routesPath' ) ) ) ; cfg . set ( 'buildBasePath' , path . resolve ( appPath , cfg . get ( 'buildBasePath' ) ) ) ; cfg . set ( 'helpersPath' , path . resolve ( appPath , cfg . get ( 'helpersPath' ) ) ) ; cfg . set ( 'handlebarsHelpersPath' , path . resolve ( appPath , cfg . get ( 'handlebarsHelpersPath' ) ) ) ; cfg . set ( 'repoWebViewBaseUri' , cfg . get ( 'repository' ) . replace ( '.git' , '/' ) ) ; keys = Object . keys ( sources ) ; for ( i = 0 ; i < keys . length ; i ++ ) { key = keys [ i ] ; cfg . set ( 'sources.' + key , path . resolve ( sourcesBasePath , sources [ key ] ) ) ; } build . css . inline [ nodeEnv ] && cfg . set ( 'build.css.inline' , path . resolve ( buildPath , build . css . inline [ nodeEnv ] ) ) ; build . css . external [ nodeEnv ] && cfg . set ( 'build.css.external' , path . resolve ( buildPath , build . css . external [ nodeEnv ] ) ) ; build . js . inline [ nodeEnv ] && cfg . set ( 'build.js.inline' , path . resolve ( buildPath , build . js . inline [ nodeEnv ] ) ) ; build . js . external [ nodeEnv ] && cfg . set ( 'build.js.external' , path . resolve ( buildPath , build . js . external [ nodeEnv ] ) ) ; cfg . set ( 'build.spritesheets' , path . resolve ( buildPath , build . spriteSheets . dirName ) ) ; return cfg ; }
Build some paths and create absolute paths from the cfg.sources using our base path
Build some paths and create absolute paths from the cfg . sources using our base path