Skip to content

Commit 2f14cd6

Browse files
committed
dev-bl/config-ip: nc.js no longer passes ip if it's undefined so brunch-server.js will properly revert to default.
1 parent f1aaadb commit 2f14cd6

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

build/brunch-server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ module.exports = (config, callback) => {
104104
// setup prompts
105105
console.log(PR);
106106
console.log(PR,DP,'GO TO ONE OF THESE URLS in CHROME WEB BROWSER',DP);
107-
console.log(PR,DP,'MAINAPP - http://localhost:'+config.port);
108-
console.log(PR,DP,'CLIENTS - http://'+IP.address()+':'+config.port);
109107
console.log(PR, DP, 'MAINAPP - http://localhost:' + config.port);
110108

111109
let ipOverride = NC_CONFIG.ip;

build/nc.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ let dataset = argv['dataset'];
66
let googlea = argv['googlea'];
77
let port = argv['port'];
88
let ip = argv['ip'];
9+
let ipDef;
910

1011
shell.echo(`
1112
+------------------------+
@@ -70,28 +71,35 @@ shell.echo(`
7071

7172
// ip
7273
if (ip === undefined || ip === '') {
73-
ip = 'default';
74-
}
75-
shell.echo(`
76-
4. Setting port to ${ip}
74+
ipDef = '';
75+
shell.echo(`
76+
4. Using default ip
7777
Use './nc.js --ip=xxx.xxx.xxx' to define a specific ip address.
7878
(This is usually only needed on specialized hosts, e.g. EC2, Docker)`
79-
);
79+
);
80+
} else {
81+
ipDef = `\n ip: "${ip}",`;
82+
shell.echo(`
83+
4. Setting ip to ${ip}
84+
Use './nc.js --ip=xxx.xxx.xxx' to define a specific ip address.
85+
(This is usually only needed on specialized hosts, e.g. EC2, Docker)`
86+
);
87+
}
8088

8189

8290
let script = `
8391
// this file generated by NC command
8492
const NC_CONFIG = {
85-
dataset: "${dataset}",
86-
ip: "${ip}",
93+
dataset: "${dataset}",${ipDef}
8794
port: "${port}",
8895
googlea: "${googlea}"
8996
};
9097
if (typeof process === "object") module.exports = NC_CONFIG;
9198
if (typeof window === "object") window.NC_CONFIG = NC_CONFIG;`
9299
let js = shell.ShellString(script).to('app/assets/netcreate-config.js');
93100

94-
shell.echo(` 5. Starting dev server...
101+
shell.echo(`
102+
5. Starting dev server...
95103
\n
96104
\n`);
97105

0 commit comments

Comments
 (0)