lib/template-generator.js
function getOutputDir() {
	const outputOptionIdx = process.argv.indexOf('-o') !== -1 ? process.argv.indexOf('-o') : process.argv.indexOf('--output-file'),
		argsLength = process.argv.length,
		outputDirOption = '--outputDirectory=';

	if (process.argv[1].includes('grunt')) {
		for (var i = 2; i < argsLength; i++) {
			if (process.argv[i].includes(outputDirOption)) {
				return `/${process.argv[i].replace(outputDirOption, '')}`;
			}
		}
		return '/reports/'; // defaults to a reports folder if nothing else is found
	} else if (outputOptionIdx !== -1) {
		return `/${process.argv[outputOptionIdx + 1].split('/')[0]}/`;
	}

	return '';
}
function getOutputDir() {
	const outputOptionIdx = process.argv.indexOf('-o') !== -1 ? process.argv.indexOf('-o') : process.argv.indexOf('--output-file'),
		argsLength = process.argv.length,
		outputDirOption = '--outputDirectory=';

	if (process.argv[1].includes('grunt')) {
		for (var i = 2; i < argsLength; i++) {
			if (process.argv[i].includes(outputDirOption)) {
				return `/${process.argv[i].replace(outputDirOption, '')}`;
			}
		}
		return '/reports/'; // defaults to a reports folder if nothing else is found
	} else if (outputOptionIdx !== -1) {
		return `/${process.argv[outputOptionIdx + 1].split('/')[0]}/`;
	}

	return '';
}
function getOutputDir ( ) { const outputOptionIdx = process . argv . indexOf ( '-o' ) !== - 1 ? process . argv . indexOf ( '-o' ) : process . argv . indexOf ( '--output-file' ) , argsLength = process . argv . length , outputDirOption = '--outputDirectory=' ; if ( process . argv [ 1 ] . includes ( 'grunt' ) ) { for ( var i = 2 ; i < argsLength ; i ++ ) { if ( process . argv [ i ] . includes ( outputDirOption ) ) { return ` ${ process . argv [ i ] . replace ( outputDirOption , '' ) } ` ; } } return '/reports/' ; // defaults to a reports folder if nothing else is found } else if ( outputOptionIdx !== - 1 ) { return ` ${ process . argv [ outputOptionIdx + 1 ] . split ( '/' ) [ 0 ] } ` ; } return '' ; }
Returns the output directory for the report
@return {String} the output directory for the report
Returns the output directory for the report