Commit 4294d6a2 authored by shangbj's avatar shangbj

'update'

parent 3eddb9db
#!/usr/bin/env bash
IFS=' '
DIR="$( cd "$( dirname "$0" )" && pwd )"
CHECKER=$DIR/../../src/cmake/Modules/cpplint.py
while read local_ref local_sha remote_ref remote_sha;
do
CHANGED_FILES=`git diff --name-only $local_sha $remote_sha | grep '\(cpp\|h\)$'`
if [ ! -z "$CHANGED_FILES" -a "$CHANGED_FILES" != " " ]; then
echo $CHANGED_FILES | xargs $CHECKER
RET=$?
if [ $RET -ne 0 ]; then
echo "There is error(s) from style-check. Please fix them before push to the repo."
exit $RET
fi
fi
done
exit 0
\ No newline at end of file
......@@ -3,11 +3,14 @@
// process.stdin.on('data', (data) => {
// console.log('++++', data)
// });
// const fs = require('fs')
// const path = require('path')
// const shell = require('shelljs')
const exec = require('child_process').exec
// var commitMsg = fs.readFileSync(path.resolve(__dirname, 'git-push.sh'), 'utf-8');
exec(`ls E:\\个人项目\\git-hooks-test\\.git`, function(err, stdout,stderr){
exec('git diff --name-only', function(err, stdout,stderr){
console.log('err',err)
console.log('stdout',stdout)
console.log('stderr',stderr)
})
\ No newline at end of file
})
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