FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TypeScript/scripts/link-hooks.js at asyncSimpleArrow · UmeshP53/TypeScript · GitHub
UmeshP53
/
TypeScript
Public
forked from
microsoft/TypeScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
TypeScript
/
scripts
/
link-hooks.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (15 loc) · 534 Bytes
Breadcrumbs
TypeScript
/
scripts
/
link-hooks.js
Copy path
File metadata and controls
20 lines (15 loc) · 534 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
var
fs
=
require
(
"fs"
)
;
var
path
=
require
(
"path"
)
;
var
hooks
=
[
"post-checkout"
]
;
hooks
.
forEach
(
function
(
hook
)
{
var
hookInSourceControl
=
path
.
resolve
(
__dirname
,
"hooks"
,
hook
)
;
if
(
fs
.
existsSync
(
hookInSourceControl
)
)
{
var
hookInHiddenDirectory
=
path
.
resolve
(
__dirname
,
".."
,
".git"
,
"hooks"
,
hook
)
;
if
(
fs
.
existsSync
(
hookInHiddenDirectory
)
)
{
fs
.
unlinkSync
(
hookInHiddenDirectory
)
;
}
fs
.
linkSync
(
hookInSourceControl
,
hookInHiddenDirectory
)
;
}
}
)
;
Back
|
FazBrowse Home
|
New Git URL