1 | const opn = require( 'opn' );
|
2 | const chalk = require( 'chalk' );
|
3 | const nconf = require( 'nconf' );
|
4 | const inquirer = require( 'inquirer' );
|
5 | const sh = require( 'shelljs' );
|
6 | const cp = require( 'child_process' );
|
7 | const util = require( '../lib/util' );
|
8 | const prompt = require( '../lib/prompt' );
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | async function ssh() {
|
14 | if ( !util.localProjectsExist() ) {
|
15 | console.error( chalk`{red.bold No projects available.}` );
|
16 | process.exit( 1 );
|
17 | }
|
18 |
|
19 | const projObj = await inquirer.prompt( prompt.getAvailableProjectsPrompt() );
|
20 |
|
21 | cp.spawnSync( 'docker', ['exec', '-it', projObj.answer, '/bin/bash'], {
|
22 | stdio : 'inherit',
|
23 | });
|
24 | }
|
25 |
|
26 | module.exports = ssh;
|