From cdb4d2a0efb3ede377d894adcb34a2bddb38ca3b Mon Sep 17 00:00:00 2001 From: rnet Date: Fri, 29 Mar 2024 00:39:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=96=E8=BE=91=E5=99=A8=E4=B8=AD?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=BF=90=E8=A1=8Cexample=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/paths.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/paths.js b/utils/paths.js index ef0fd61..93f4390 100644 --- a/utils/paths.js +++ b/utils/paths.js @@ -3,7 +3,7 @@ const fs = require('fs'); const appDirectory = (() => { // 返回项目根目录 - const plist = fs.realpathSync(process.cwd()).split('/'); + const plist = fs.realpathSync(__dirname).split('/'); while (!fs.existsSync(path.resolve(plist.join('/'), 'package.json'))) { plist.pop(); if (plist.length === 0) return false; @@ -17,7 +17,7 @@ module.exports = { homePath: __dirname, modulePath: resolveApp('node_modules'), binPath: resolveApp('node_modules/.bin/'), - package: path.resolve('package.json'), + package: resolveApp('package.json'), resolve: resolveApp, handlerPath: resolveApp('handler'), configPath: resolveApp('config'),