FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/lifecycleScripts/install.js at unsmart-build · schuth/nodegit · GitHub
schuth
nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
lifecycleScripts
/
install.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (44 loc) · 1.32 KB
Breadcrumbs
nodegit
/
lifecycleScripts
/
install.js
Copy path
File metadata and controls
51 lines (44 loc) · 1.32 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
var
promisify
=
require
(
"promisify-node"
)
;
var
path
=
require
(
"path"
)
;
var
fs
=
require
(
"fs"
)
;
var
checkPrepared
=
require
(
"./checkPrepared"
)
;
var
prepareForBuild
=
require
(
"./prepareForBuild"
)
;
var
exec
=
promisify
(
function
(
command
,
opts
,
callback
)
{
return
require
(
"child_process"
)
.
exec
(
command
,
opts
,
callback
)
;
}
)
;
var
local
=
path
.
join
.
bind
(
path
.
join
,
__dirname
)
;
if
(
fs
.
existsSync
(
local
(
"../.didntcomefromthenpmregistry"
)
)
)
{
return
checkAndBuild
(
)
;
}
if
(
process
.
env
.
BUILD_DEBUG
)
{
console
.
info
(
"[nodegit] Doing a debug build, no fetching allowed."
)
;
return
checkAndBuild
(
)
;
}
if
(
process
.
env
.
BUILD_ONLY
)
{
console
.
info
(
"[nodegit] BUILD_ONLY is set to true, no fetching allowed."
)
;
return
checkAndBuild
(
)
;
}
console
.
info
(
"[nodegit] Fetching binary from S3."
)
;
return
exec
(
"node-pre-gyp install"
)
.
then
(
function
(
)
{
console
.
info
(
"[nodegit] Completed installation successfully."
)
;
}
,
function
(
)
{
console
.
info
(
"[nodegit] Failed to install prebuilt binary, "
+
"building manually."
)
;
return
checkAndBuild
(
)
;
}
)
;
function
checkAndBuild
(
)
{
console
.
info
(
"[nodegit] Making sure dependencies are available and native "
+
"code is generated"
)
;
return
prepareForBuild
(
)
.
then
(
function
(
)
{
process
.
exit
(
0
)
;
}
,
function
(
)
{
process
.
exit
(
1
)
;
}
)
;
}
Back
|
FazBrowse Home
|
New Git URL