FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/lifecycleScripts/install.js at v0.26.2 · nodegit/nodegit · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
nodegit
/
nodegit
Public
Notifications
You must be signed in to change notification settings
Fork
701
Star
5.8k
Code
Issues
343
Pull requests
20
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
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
62 lines (51 loc) · 1.48 KB
Breadcrumbs
nodegit
/
lifecycleScripts
/
install.js
Copy path
File metadata and controls
62 lines (51 loc) · 1.48 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
52
53
54
55
56
57
58
59
60
61
62
var
buildFlags
=
require
(
"../utils/buildFlags"
)
;
var
spawn
=
require
(
"child_process"
)
.
spawn
;
module
.
exports
=
function
install
(
)
{
console
.
log
(
"[nodegit] Running install script"
)
;
var
nodePreGyp
=
"node-pre-gyp"
;
if
(
process
.
platform
===
"win32"
)
{
nodePreGyp
+=
".cmd"
;
}
var
args
=
[
"install"
]
;
if
(
buildFlags
.
mustBuild
)
{
console
.
info
(
"[nodegit] Pre-built download disabled, building from source."
)
;
args
.
push
(
"--build-from-source"
)
;
if
(
buildFlags
.
debugBuild
)
{
console
.
info
(
"[nodegit] Building debug version."
)
;
args
.
push
(
"--debug"
)
;
}
}
else
{
args
.
push
(
"--fallback-to-build"
)
;
}
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
spawnedNodePreGyp
=
spawn
(
nodePreGyp
,
args
)
;
spawnedNodePreGyp
.
stdout
.
on
(
"data"
,
function
(
data
)
{
console
.
info
(
data
.
toString
(
)
.
trim
(
)
)
;
}
)
;
spawnedNodePreGyp
.
stderr
.
on
(
"data"
,
function
(
data
)
{
console
.
error
(
data
.
toString
(
)
.
trim
(
)
)
;
}
)
;
spawnedNodePreGyp
.
on
(
"close"
,
function
(
code
)
{
if
(
!
code
)
{
resolve
(
)
;
}
else
{
reject
(
code
)
;
}
}
)
;
}
)
.
then
(
function
(
)
{
console
.
info
(
"[nodegit] Completed installation successfully."
)
;
}
)
;
}
;
// Called on the command line
if
(
require
.
main
===
module
)
{
module
.
exports
(
)
.
catch
(
function
(
e
)
{
console
.
error
(
"[nodegit] ERROR - Could not finish install"
)
;
console
.
error
(
"[nodegit] ERROR - finished with error code: "
+
e
)
;
process
.
exit
(
e
)
;
}
)
;
}
Back
|
FazBrowse Home
|
New Git URL