You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
754 B
30 lines
754 B
import { isUndefined } from 'lodash';
|
|
import { SSH, SSL, Server } from '../interfaces';
|
|
import { Options } from './options';
|
|
|
|
export function unWrapArgs(
|
|
args: Options
|
|
): { ssh: SSH; server: Server; command?: string; ssl?: SSL } {
|
|
return {
|
|
ssh: {
|
|
user: args.sshuser,
|
|
host: args.sshhost,
|
|
auth: args.sshauth,
|
|
port: args.sshport,
|
|
pass: args.sshpass,
|
|
key: args.sshkey,
|
|
},
|
|
server: {
|
|
base: args.base,
|
|
host: args.host,
|
|
port: args.port,
|
|
title: args.title,
|
|
bypasshelmet: args.bypasshelmet || false,
|
|
},
|
|
command: args.command,
|
|
ssl:
|
|
isUndefined(args.sslkey) || isUndefined(args.sslcert)
|
|
? undefined
|
|
: { key: args.sslkey, cert: args.sslcert },
|
|
};
|
|
}
|
|
|