!3234 Fix the problem that the projectRootPath field is undefined in FA mode

Merge pull request !3234 from 吴海龙/bugfix
This commit is contained in:
openharmony_ci 2024-04-07 14:38:45 +00:00 committed by Gitee
commit b5eeb77b38
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -97,6 +97,7 @@ export function initArkConfig(projectConfig: Object): ArkConfig {
export function initArkProjectConfig(share: Object): Object {
let projectConfig: Object = share.projectConfig;
let arkProjectConfig: Object = {};
arkProjectConfig.projectRootPath = share.projectConfig.projectTopDir;
if (projectConfig.aceBuildJson && fs.existsSync(projectConfig.aceBuildJson)) {
const buildJsonInfo = JSON.parse(fs.readFileSync(projectConfig.aceBuildJson).toString());
arkProjectConfig.projectRootPath = buildJsonInfo.projectRootPath;