2020-10-21 17:25:13 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
const path = require( 'path' );
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2021-01-19 15:02:08 +00:00
|
|
|
const { getTestConfig } = require( './test-config' );
|
2020-10-21 17:25:13 +00:00
|
|
|
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,
|
|
|
|
};
|