FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
atom/script/bootstrap at master · bryanhelmig/atom · GitHub
bryanhelmig
/
atom
Public
forked from
atom/atom
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
atom
/
script
/
bootstrap
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
99 lines (86 loc) · 3.28 KB
Breadcrumbs
atom
/
script
/
bootstrap
Copy path
File metadata and controls
executable file
·
99 lines (86 loc) · 3.28 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env node
var
fs
=
require
(
'fs'
)
;
var
verifyRequirements
=
require
(
'./utils/verify-requirements'
)
;
var
safeExec
=
require
(
'./utils/child-process-wrapper.js'
)
.
safeExec
;
var
path
=
require
(
'path'
)
;
// Executes an array of commands one by one.
function
executeCommands
(
commands
,
done
,
index
)
{
index
=
(
index
==
undefined
?
0
:
index
)
;
if
(
index
<
commands
.
length
)
{
var
command
=
commands
[
index
]
;
if
(
command
.
message
)
console
.
log
(
command
.
message
)
;
var
options
=
null
;
if
(
typeof
command
!==
'string'
)
{
options
=
command
.
options
;
command
=
command
.
command
;
}
safeExec
(
command
,
options
,
executeCommands
.
bind
(
this
,
commands
,
done
,
index
+
1
)
)
;
}
else
done
(
null
)
;
}
function
bootstrap
(
)
{
var
apmInstallPath
=
path
.
resolve
(
__dirname
,
'..'
,
'apm'
)
;
if
(
!
fs
.
existsSync
(
apmInstallPath
)
)
fs
.
mkdirSync
(
apmInstallPath
)
;
if
(
!
fs
.
existsSync
(
path
.
join
(
apmInstallPath
,
'node_modules'
)
)
)
fs
.
mkdirSync
(
path
.
join
(
apmInstallPath
,
'node_modules'
)
)
;
var
apmPath
=
path
.
resolve
(
__dirname
,
'..'
,
'apm'
,
'node_modules'
,
'atom-package-manager'
,
'bin'
,
'apm'
)
var
apmFlags
=
process
.
env
.
JANKY_SHA1
||
process
.
argv
.
indexOf
(
'--no-color'
)
!==
-
1
?
' --no-color'
:
''
;
var
npmPath
=
path
.
resolve
(
__dirname
,
'..'
,
'build'
,
'node_modules'
,
'.bin'
,
'npm'
)
;
var
initialNpmCommand
=
fs
.
existsSync
(
npmPath
)
?
npmPath
:
'npm'
;
var
npmFlags
=
' --userconfig='
+
path
.
resolve
(
'.npmrc'
)
+
' '
;
var
packagesToDedupe
=
[
'fs-plus'
,
'humanize-plus'
,
'oniguruma'
,
'roaster'
,
'season'
,
'grim'
]
;
var
buildInstallCommand
=
initialNpmCommand
+
npmFlags
+
'install'
;
var
buildInstallOptions
=
{
cwd
:
path
.
resolve
(
__dirname
,
'..'
,
'build'
)
}
;
var
apmInstallCommand
=
npmPath
+
npmFlags
+
'install'
;
var
apmInstallOptions
=
{
cwd
:
apmInstallPath
}
;
var
moduleInstallCommand
=
apmPath
+
' install'
+
apmFlags
;
var
dedupeApmCommand
=
apmPath
+
' dedupe'
+
apmFlags
;
var
dedupeNpmCommand
=
npmPath
+
npmFlags
+
'dedupe'
;
if
(
process
.
argv
.
indexOf
(
'--no-quiet'
)
===
-
1
)
{
buildInstallCommand
+=
' --quiet'
;
apmInstallCommand
+=
' --quiet'
;
moduleInstallCommand
+=
' --quiet'
;
dedupeApmCommand
+=
' --quiet'
;
dedupeNpmCommand
+=
' --quiet'
;
buildInstallOptions
.
ignoreStdout
=
true
;
apmInstallOptions
.
ignoreStdout
=
true
;
}
// apm ships with 32-bit node so make sure its native modules are compiled
// for a 32-bit target architecture
if
(
process
.
env
.
JANKY_SHA1
&&
process
.
platform
===
'win32'
)
apmInstallCommand
+=
' --arch=ia32'
;
var
commands
=
[
{
command
:
buildInstallCommand
,
message
:
'Installing build modules...'
,
options
:
buildInstallOptions
}
,
{
command
:
apmInstallCommand
,
message
:
'Installing apm...'
,
options
:
apmInstallOptions
}
,
apmPath
+
' clean'
+
apmFlags
,
moduleInstallCommand
,
dedupeApmCommand
+
' '
+
packagesToDedupe
.
join
(
' '
)
,
{
command
:
dedupeNpmCommand
+
' request semver'
,
options
:
{
cwd
:
path
.
resolve
(
__dirname
,
'..'
,
'apm'
,
'node_modules'
,
'atom-package-manager'
)
}
}
,
]
;
process
.
chdir
(
path
.
dirname
(
__dirname
)
)
;
executeCommands
(
commands
,
process
.
exit
)
;
}
verifyRequirements
(
function
(
error
,
successMessage
)
{
if
(
error
)
{
console
.
log
(
error
)
;
process
.
exit
(
1
)
;
}
console
.
log
(
successMessage
)
;
bootstrap
(
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL