UNPKG

alwaysai

Version:

The alwaysAI command-line interface (CLI)

20 lines 806 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.connectBySsh = exports.TIMED_OUT_CONNECTING_TO = void 0; const alwayscli_1 = require("@alwaysai/alwayscli"); const delay = require("delay"); const spawner_1 = require("./spawner"); const TEN_SECONDS = 10 * 1000; exports.TIMED_OUT_CONNECTING_TO = 'Timed out connecting to'; async function connectBySsh(props) { const { targetHostname } = props; const spawner = (0, spawner_1.SshSpawner)({ targetHostname }); await Promise.race([ spawner.run({ exe: 'echo' }), delay.reject(TEN_SECONDS, { value: new alwayscli_1.CliTerseError(`${exports.TIMED_OUT_CONNECTING_TO} "${targetHostname}"`) }) ]); } exports.connectBySsh = connectBySsh; //# sourceMappingURL=connect-by-ssh.js.map