From bcfa84636d669cdee20af8cca40364d90bd7af11 Mon Sep 17 00:00:00 2001 From: wangqing Date: Wed, 19 Oct 2022 15:51:24 +0800 Subject: [PATCH] fix api_check Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index f07cfa6646..2bc25c700f 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -19,6 +19,7 @@ const { writeResultFile } = require('./src/utils'); function checkEntry(url) { let result = "API CHECK FAILED!"; + const sourceDirname = __dirname; __dirname = "interface/sdk-js/build-tools/api_check_plugin"; try { const execSync = require("child_process").execSync; @@ -26,12 +27,12 @@ function checkEntry(url) { const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); result = scanEntry(url); const content = fs.readFileSync(url, "utf-8"); - result += `mdFilePath = ${url}, content = ${content}` + result += `mdFilePath = ${url}, content = ${content}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; const { removeDir } = require(path.resolve(__dirname, "./src/utils")); removeDir(path.resolve(__dirname, "node_modules")); } catch (error) { // catch error - result = `CATCHERROR : ${error}`; + result = `CATCHERROR : ${error}, mdFilePath = ${url}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; } writeResultFile(result, path.resolve(__dirname, "./Result.txt"), {}); } -- Gitee