mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-05 19:41:57 +08:00
14 lines
337 B
JavaScript
14 lines
337 B
JavaScript
const { join, isAbsolute } = require('path');
|
|
|
|
module.exports = () => {
|
|
const cwd = process.cwd();
|
|
if (process.env.APP_ROOT) {
|
|
// avoid repeat cwd path
|
|
if (!isAbsolute(process.env.APP_ROOT)) {
|
|
return join(cwd, process.env.APP_ROOT);
|
|
}
|
|
return process.env.APP_ROOT;
|
|
}
|
|
return cwd;
|
|
};
|