Skip to content

Commit

Permalink
fix: postinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
sj817 committed Sep 15, 2024
1 parent 000aebd commit 7e5dba2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- run: npm install -g pnpm
if: ${{ steps.release.outputs.release_created }}
# 安装依赖 不安装对等依赖
- run: pnpm install --config.auto-install-peers=false
- run: pnpm install --config.auto-install-peers=false --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.RELEASE }}
if: ${{ steps.release.outputs.release_created }}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@
"dev": "node lib/cli/start.js dev",
"fix": "eslint lib/**/*.js --fix",
"fix:all": "eslint lib/**/*.js --fix && eslint lib/**/*.d.ts --fix",
"init": "node lib/cli/init.js",
"postinstall": "npm run init",
"pub": "npm publish --access public",
"sort": "npx sort-package-json && sort-json tsconfig.json",
"start": "node lib/cli/start.js start",
"postinstall": "node lib/cli/init.js"
"start": "node lib/cli/start.js start"
},
"dependencies": {
"@types/express": "^4.17.21",
Expand Down
2 changes: 2 additions & 0 deletions src/cli/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { getRegistry } from './pkg'
import { KarinCfgInit } from '../core/init/config'
import { isPkg } from 'karin/core/init/dir'

/**
* 休眠函数
Expand All @@ -12,6 +13,7 @@ function sleep (ms: number) {
}

async function main () {
if (!isPkg) return
/** 捕获错误 打印日志 */
process.on('uncaughtException', err => console.error(err))
process.on('unhandledRejection', err => console.error(err))
Expand Down

0 comments on commit 7e5dba2

Please sign in to comment.