2020-10-21 17:25:13 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
const path = require( 'path' );
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
const getTestConfig = require( './test-config' );
|
|
|
|
const getAppRoot = require( './app-root' );
|
|
|
|
|
|
|
|
const getAppName = () => {
|
|
|
|
const testConfig = getTestConfig();
|
|
|
|
if ( testConfig.appName ) {
|
|
|
|
return testConfig.appName;
|
|
|
|
}
|
2021-01-13 11:27:11 +00:00
|
|
|
return getAppBase();
|
|
|
|
};
|
|
|
|
|
|
|
|
const getAppBase = () => {
|
2020-10-21 17:25:13 +00:00
|
|
|
const appRoot = getAppRoot();
|
|
|
|
return path.basename( appRoot );
|
2021-01-13 11:27:11 +00:00
|
|
|
}
|
2020-10-21 17:25:13 +00:00
|
|
|
|
2021-01-13 11:27:11 +00:00
|
|
|
module.exports = {
|
|
|
|
getAppName,
|
|
|
|
getAppBase,
|
|
|
|
};
|