first commit

This commit is contained in:
armansansd
2023-07-12 16:31:19 +01:00
commit 3424b1927b
23306 changed files with 2217776 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
const chalk = require('chalk')
const spawn = require('child_process').spawn
console.log(chalk.yellow('🐶 Checking tests before committing...'))
const child = spawn('npm run test', [], { shell: true })
child.stdout.on('data', function (data) {
process.stdout.write(data)
})
child.on('error', function (err) {
console.log(chalk.red(err))
})
child.on('exit', function (code) {
if(code === 0){
console.log(chalk.yellow('🐶 ✓ Tests run well, we can commit...'))
} else {
console.log(chalk.yellow('🐶 ✗ Tests are failing, please fix them before committing.'))
process.exit(code);
}
})