Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
G
git-hooks-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shangbj
git-hooks-test
Commits
4294d6a2
Commit
4294d6a2
authored
Mar 15, 2020
by
shangbj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'update'
parent
3eddb9db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
git-push.sh
build/git-push.sh
+17
-0
push.js
build/push.js
+6
-3
No files found.
build/git-push.sh
0 → 100644
View file @
4294d6a2
#!/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
build/push.js
View file @
4294d6a2
...
...
@@ -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
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment