@@ -5,7 +5,10 @@ let argv = require('minimist')(process.argv.slice(2));
5
5
let dataset = argv [ 'dataset' ] ;
6
6
let googlea = argv [ 'googlea' ] ;
7
7
let port = argv [ 'port' ] ;
8
+ let netport = argv [ 'netport' ] ;
8
9
let ip = argv [ 'ip' ] ;
10
+
11
+ let netportDef ;
9
12
let ipDef ;
10
13
11
14
shell . echo ( `
@@ -69,18 +72,36 @@ shell.echo(`
69
72
) ;
70
73
71
74
75
+ // netport
76
+ if ( netport === undefined || netport === '' ) {
77
+ netportDef = '' ;
78
+ shell . echo ( `
79
+ 4. Using default netport
80
+ Use './nc.js --netport=xxxx' to define a specific network port.
81
+ (This is usually only needed when running multiple servers on the same host)`
82
+ ) ;
83
+ } else {
84
+ netportDef = `\n netport: "${ netport } ",` ;
85
+ shell . echo ( `
86
+ 4. Setting netport to ${ netport }
87
+ Use './nc.js --netport=xxx.xxx.xxx' to define a specific network port.
88
+ (This is usually only needed when running multiple servers on the same host)`
89
+ ) ;
90
+ }
91
+
92
+
72
93
// ip
73
94
if ( ip === undefined || ip === '' ) {
74
95
ipDef = '' ;
75
96
shell . echo ( `
76
- 4 . Using default ip
97
+ 5 . Using default ip
77
98
Use './nc.js --ip=xxx.xxx.xxx' to define a specific ip address.
78
99
(This is usually only needed on specialized hosts, e.g. EC2, Docker)`
79
100
) ;
80
101
} else {
81
102
ipDef = `\n ip: "${ ip } ",` ;
82
103
shell . echo ( `
83
- 4 . Setting ip to ${ ip }
104
+ 5 . Setting ip to ${ ip }
84
105
Use './nc.js --ip=xxx.xxx.xxx' to define a specific ip address.
85
106
(This is usually only needed on specialized hosts, e.g. EC2, Docker)`
86
107
) ;
@@ -90,16 +111,16 @@ if (ip === undefined || ip === '') {
90
111
let script = `
91
112
// this file generated by NC command
92
113
const NC_CONFIG = {
93
- dataset: "${ dataset } ",${ ipDef }
94
- port: "${ port } ",
114
+ dataset: "${ dataset } ",
115
+ port: "${ port } ",${ netportDef } ${ ipDef }
95
116
googlea: "${ googlea } "
96
117
};
97
118
if (typeof process === "object") module.exports = NC_CONFIG;
98
119
if (typeof window === "object") window.NC_CONFIG = NC_CONFIG;`
99
120
let js = shell . ShellString ( script ) . to ( 'app/assets/netcreate-config.js' ) ;
100
121
101
122
shell . echo ( `
102
- 5 . Starting dev server...
123
+ 6 . Starting dev server...
103
124
\n
104
125
\n` ) ;
105
126
0 commit comments