FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
react-native/cli.js at master · davidhellsing/react-native · GitHub
davidhellsing
/
react-native
Public
forked from
react/react-native
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
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
react-native
/
cli.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (41 loc) · 933 Bytes
Breadcrumbs
react-native
/
cli.js
Copy path
File metadata and controls
48 lines (41 loc) · 933 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*/
'use strict'
;
var
spawn
=
require
(
'child_process'
)
.
spawn
;
var
path
=
require
(
'path'
)
;
function
printUsage
(
)
{
console
.
log
(
[
'Usage: react-native <command>'
,
''
,
'Commands:'
,
' start: starts the webserver'
,
]
.
join
(
'\n'
)
)
;
process
.
exit
(
1
)
;
}
function
run
(
)
{
var
args
=
process
.
argv
.
slice
(
2
)
;
if
(
args
.
length
===
0
)
{
printUsage
(
)
;
}
switch
(
args
[
0
]
)
{
case
'start'
:
spawn
(
'sh'
,
[
path
.
resolve
(
__dirname
,
'packager'
,
'packager.sh'
)
,
'--projectRoots'
,
process
.
cwd
(
)
,
]
,
{
stdio
:
'inherit'
}
)
;
break
;
default
:
console
.
error
(
'Command `%s` unrecognized'
,
args
[
0
]
)
;
printUsage
(
)
;
}
// Here goes any cli commands we need to
}
function
init
(
root
,
projectName
)
{
spawn
(
path
.
resolve
(
__dirname
,
'init.sh'
)
,
[
projectName
]
,
{
stdio
:
'inherit'
}
)
;
}
module
.
exports
=
{
run
:
run
,
init
:
init
,
}
;
Back
|
FazBrowse Home
|
New Git URL