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 ...@@ -19,6 +19,6 @@ selenium-debug.log
*.njsproj *.njsproj
*.sln *.sln
*.local *.local
*.history
package-lock.json package-lock.json
yarn.lock 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
...@@ -79,7 +79,8 @@ ...@@ -79,7 +79,8 @@
"stylelint-order": "^5.0.0", "stylelint-order": "^5.0.0",
"svg-sprite-loader": "5.1.1", "svg-sprite-loader": "5.1.1",
"vue-cli-plugin-commitlint": "~1.0.12", "vue-cli-plugin-commitlint": "~1.0.12",
"vue-template-compiler": "2.6.12" "vue-template-compiler": "2.6.12",
"zx": "^7.2.3"
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
......
#!/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