FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-gitlab/examples/reset-hooks.coffee at master · moul/node-gitlab · GitHub
This repository was archived by the owner on Oct 24, 2019. It is now read-only.
moul
/
node-gitlab
Public archive
Notifications
You must be signed in to change notification settings
Fork
137
Star
467
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
node-gitlab
/
examples
/
reset-hooks.coffee
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (25 loc) · 893 Bytes
Breadcrumbs
node-gitlab
/
examples
/
reset-hooks.coffee
Copy path
File metadata and controls
31 lines (25 loc) · 893 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#
!/usr/bin/env coffee
#
clear terminal
process
.
stdout
.
write
'
\u
001B[2J
\u
001B[0;0f
'
Gitlab
=
require
(
'
..
'
)
credentials
=
require
'
./credentials
'
gitlab
=
new
Gitlab
url
:
credentials
.
url
token
:
credentials
.
token
gitlab
.
projects
.
all
(projects)
->
for
_project
in
projects
do
->
project
=
_project
gitlab
.
projects
.
hooks
.
list
project
.
id
, (
hooks
)
->
url
=
"
#{
credentials
.
service_hook_base
}#{
project
.
path_with_namespace
}
"
if
hooks
.
length
>
1
console
.
log
"
#{
url
}
too much hooks
"
else
if
hooks
.
length
is
1
for
hook
in
hooks
if
hook
.
url
!=
url
gitlab
.
projects
.
hooks
.
remove
project
.
id
,
hook
.
id
, (
ret
)
->
console
.
log
ret
console
.
log
"
#{
url
}
is already OK
"
else
gitlab
.
projects
.
hooks
.
add
project
.
id
, url,
->
console
.
log
"
#{
url
}
has been added
"
Back
|
FazBrowse Home
|
New Git URL