UNPKG

@gameroom/cli

Version:

A command line tool for Gameroom

15 lines (13 loc) 493 B
const { getServiceUrlAndPort, runCommand, runOsascript } = require('../consoleIO') module.exports = async (options) => { const { url, port } = await getServiceUrlAndPort('ssh', options) let command = `ssh -p ${port} infinitetoken@${url}` if (options.command) { command += ` '${options.command}'` console.log(command) const result = await runCommand(command) console.log(result.replace(/^\s+|\s+$/g, '')) } else { runOsascript(command, options['new-window']) } }