"deploy:prep": "gulp deploy:prep",
"deploy:docs": "gulp deploy:docs",
"deploy:beta": "gulp deploy:beta",
- "precommit": "./script/husky-precommit",
+ "precommit": "node ./script/husky-precommit.js",
"prepush": "./script/husky-prepush"
},
"dependencies": {
+++ /dev/null
-#!/bin/bash
-
-{
- echo -e "\033[33m🐶 Checking tests before committing with Husky...\033[0m" &&
- npm run test &&
- echo -e "\033[33m🐶 ✓ Tests run well, we can commit...\033[0m"
-} || {
- echo -e "\033[33m🐶 ✗ Tests are failing, please fix them before committing.\033[0m"
- exit 1
-}
--- /dev/null
+const chalk = require('chalk')
+const spawn = require('child_process').spawn
+
+console.log(chalk.yellow('🐶 Checking tests before committing with Husky...'))
+
+const child = spawn('npm run test', [], { shell: true })
+
+child.stdout.on('data', function (data) {
+ process.stdout.write(data)
+})
+
+child.on('exit', function (code) {
+ if(code === 0){
+ console.log(chalk.yellow(code, '🐶 ✓ Tests run well, we can commit...'))
+ } else {
+ console.log(chalk.yellow('🐶 ✗ Tests are failing, please fix them before committing.'))
+ }
+})
+
+child.on('error', function (err) {
+ console.log(chalk.red(err))
+})
\ No newline at end of file
+++ /dev/null
-#!/bin/bash
-
-{
- echo -e "\033[33m🐶 Checking tests before pushing with Husky...\033[0m" &&
- npm run test &&
- echo -e "\033[33m🐶 ✓ Tests run well, we can push...\033[0m"
-} || {
- echo -e "\033[33m🐶 ✗ Tests are failing, please fix them before pushing.\033[0m"
- exit 1
-}
--- /dev/null
+const chalk = require('chalk')
+const spawn = require('child_process').spawn
+
+console.log(chalk.yellow('🐶 Checking tests before pushing with Husky...'))
+
+const child = spawn('npm run test', [], { shell: true })
+
+child.stdout.on('data', function (data) {
+ process.stdout.write(data)
+})
+
+child.on('exit', function (code) {
+ if(code === 0){
+ console.log(chalk.yellow(code, '🐶 ✓ Tests run well, we can push...'))
+ } else {
+ console.log(chalk.yellow('🐶 ✗ Tests are failing, please fix them before pushing.'))
+ }
+})
+
+child.on('error', function (err) {
+ console.log(chalk.red(err))
+})
\ No newline at end of file