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
d3510309
Commit
d3510309
authored
Mar 14, 2020
by
shangbj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
ef4c7b0f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
hooks.js
build/hooks.js
+3
-3
push.js
build/push.js
+1
-1
package.json
package.json
+1
-1
No files found.
build/hooks.js
View file @
d3510309
...
...
@@ -11,10 +11,10 @@ var path = require('path');
// console.log('______', process.env.HUSKY_GIT_STDIN, process.env.HUSKY_GIT_PARAMS, process.env.GIT_INTERNAL_GETTEXT_SH_SCHEME, process.env.GIT_AUTHOR_EMAIL)
var
gitPath
=
path
.
resolve
(
__dirname
,
`../
${
process
.
env
.
HUSKY_GIT_PARAMS
}
`
);
var
commitMsg
=
fs
.
readFileSync
(
gitPath
,
'utf-8'
);
var
gitMerge
=
path
.
resolve
(
__dirname
,
'../.git/MERGE_MSG'
);
var
mergeMsg
=
fs
.
readFileSync
(
gitMerge
,
'utf-8'
);
//
var gitMerge = path.resolve(__dirname, '../.git/MERGE_MSG');
//
var mergeMsg = fs.readFileSync(gitMerge, 'utf-8');
console
.
log
(
'----'
,
mergeMsg
.
toString
())
//
console.log('----', mergeMsg.toString())
var
pattern
=
/<<< HEAD/g
;
if
(
pattern
.
test
(
commitMsg
))
{
...
...
build/push.js
View file @
d3510309
console
.
log
(
process
.
env
.
GIT_PUSH_OPTION_COUNT
)
\ No newline at end of file
console
.
log
(
'___'
,
process
.
env
.
GIT_PREFIX
)
\ No newline at end of file
package.json
View file @
d3510309
...
...
@@ -13,7 +13,7 @@
"husky"
:
{
"hooks"
:
{
"commit-msg"
:
"node ./build/hooks.js $HUSKY_GIT_PARAMS $HUSKY_GIT_STDIN $GIT_INTERNAL_GETTEXT_SH_SCHEME $GIT_AUTHOR_EMAIL"
,
"pre-push"
:
"node ./build/push.js $GIT_P
USH_OPTION_COUNT
"
"pre-push"
:
"node ./build/push.js $GIT_P
REFIX
"
}
},
"keywords"
:
[],
...
...
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