mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-23 03:59:10 +08:00
docs: up website & sh
This commit is contained in:
23
script/check-commit.js
Executable file
23
script/check-commit.js
Executable file
@@ -0,0 +1,23 @@
|
||||
const chalk = require('chalk');
|
||||
const simpleGit = require('simple-git/promise');
|
||||
|
||||
const cwd = process.cwd();
|
||||
const git = simpleGit(cwd);
|
||||
|
||||
async function checkCommit({ files }) {
|
||||
if (files.length) {
|
||||
console.log(chalk.yellow('🙄 You forgot something to commit.'));
|
||||
files.forEach(({ path: filePath }) => {
|
||||
console.log(' -', chalk.red(filePath));
|
||||
});
|
||||
console.log('');
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
const status = await git.status();
|
||||
await checkCommit(status);
|
||||
}
|
||||
|
||||
run();
|
Reference in New Issue
Block a user