Skip to content

Commit

Permalink
fix: remove npx faim-fix due to the unexpected process.cwd() value
Browse files Browse the repository at this point in the history
  • Loading branch information
cloydlau committed Jan 24, 2024
1 parent 616e2ed commit 43cc48e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npm i faim
>
> 由于需要修改 Element Plus 源码才得以实现 FaImageUpload,故**该组件在 Element Plus 环境**存在以下限制:
>
> - element-plus 不能晚于 faim 安装 (可执行 `npx faim-fix` 修复)
> - element-plus 不能晚于 faim 安装
> - 通过 CDN 的方式使用时需要自行修改 ElUpload 源码
> [!Warning]
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
"unpkg": "./dist/index.mjs",
"jsdelivr": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"bin": {
"faim-fix": "./scripts/postinstall.mjs"
},
"files": [
"auto-import-resolver.ts",
"dist",
Expand Down
4 changes: 2 additions & 2 deletions scripts/postinstall.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const name = 'faim'
async function postinstall() {
const cwd = process.cwd()
const isDev = process.env.INIT_CWD === cwd
// faim 的目录 (可能是 xxx/faim 或 xxx/node_modules/faim)
// 当前 Node.js 进程的工作目录,通常是 faim 的目录
console.log(cyan(`[INFO] process.cwd(): ${cwd}`))
// 直接或间接执行 postinstall 的目录 (xxx 或者 xxx/faim)
// 最初启动 Node.js 进程时的工作目录,比如执行 ni 的目录
console.log(cyan(`[INFO] process.env.INIT_CWD: ${process.env.INIT_CWD}`))
const elementPlusDir = `${process.env.INIT_CWD}/node_modules/element-plus`
const isElementPlusInstalled = fs.existsSync(elementPlusDir)
Expand Down

0 comments on commit 43cc48e

Please sign in to comment.