export default function doConnect() { client = new AdminClient({ username: username, password: password, md5: true }); let id = 'pinus_cli_' + Date.now(); client.connect(id, host, port, function (err: Error) { if (err) { util.log('\n' + err + '\n'); process.exit(0); } else { let ASCII_LOGO = consts.ASCII_LOGO; for (let i = 0; i < ASCII_LOGO.length; i++) { util.log(ASCII_LOGO[i]); } let WELCOME_INFO = consts.WELCOME_INFO; for (let i = 0, l = WELCOME_INFO.length; i < l; i++) { util.log(WELCOME_INFO[i]); } startCli(); } }); client.on('close', function () { client.socket.disconnect(); util.log('\ndisconnect from master'); process.exit(0); }); }
export default function doConnect() { client = new AdminClient({ username: username, password: password, md5: true }); let id = 'pinus_cli_' + Date.now(); client.connect(id, host, port, function (err: Error) { if (err) { util.log('\n' + err + '\n'); process.exit(0); } else { let ASCII_LOGO = consts.ASCII_LOGO; for (let i = 0; i < ASCII_LOGO.length; i++) { util.log(ASCII_LOGO[i]); } let WELCOME_INFO = consts.WELCOME_INFO; for (let i = 0, l = WELCOME_INFO.length; i < l; i++) { util.log(WELCOME_INFO[i]); } startCli(); } }); client.on('close', function () { client.socket.disconnect(); util.log('\ndisconnect from master'); process.exit(0); }); }