Commit c422f4ac authored by jiaxu.yan's avatar jiaxu.yan

提提交

parent 4036988c
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -19,6 +19,6 @@ selenium-debug.log
*.njsproj
*.sln
*.local
*.history
package-lock.json
yarn.lock
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no -- commitlint --edit ${1}
npm run commitlint ${1}
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"
npm exec run ./scripts/pre-commit.js
#!/usr/bin/env zx
// import type { ProcessOutput } from 'zx'
import { $ } from 'zx'
import { printObject } from './utils'
// await $`npm run spellcheck`.catch((out) => {
// console.log(out)
// throw new Error(out.stdout)
// })
// check type and stage
await Promise.all([ $`npm run lint`]).catch((out) => {
printObject(out)
throw new Error(out.stdout)
})
#!/usr/bin/env zx
import { $ } from 'zx'
console.log('开始执行代码质量评估...\n')
await import('./check').catch((out) => {
throw new Error('代码质量评估失败, 请检查代码')
})
console.log('printf "检测通过, 创建 commit 中...\n')
await $`git add .`
import { ProcessOutput } from 'zx/core'
export function printObject(
object,
method = 'log'
) {
for (const [key, value] of Object.entries(object)) {
// eslint-disable-next-line no-console
console[method](`${key}:\n${value}\n`)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment