mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Rewrite git hook
This commit is contained in:
parent
be4d3bb6d9
commit
742781a264
7
.githooks/install.js
Normal file
7
.githooks/install.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
const { spawn } = require('child_process');
|
||||||
|
|
||||||
|
const subprocess = spawn('git', ['config', '--local', 'core.hooksPath', '.githooks/']);
|
||||||
|
|
||||||
|
subprocess.on('error', () => {
|
||||||
|
console.error('Failed to install git hook.');
|
||||||
|
});
|
||||||
@ -14,7 +14,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"eslint": "eslint scripts/ source/js test/",
|
"eslint": "eslint scripts/ source/js test/",
|
||||||
"prepare": "git config --local core.hooksPath .githooks/",
|
"prepare": "node .githooks/install.js",
|
||||||
"stylint": "stylint source/css/",
|
"stylint": "stylint source/css/",
|
||||||
"test": "mocha test/index.js"
|
"test": "mocha test/index.js"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user