From 2d14617b132f95f75a563f67406e82cfb09b71bd Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 1 Jun 2016 00:56:24 +0200 Subject: [PATCH] rename Ssh class to SshInstance --- ts/index.ts | 2 +- ts/smartssh.classes.sshdir.ts | 10 ++++++++-- ....classes.ssh.ts => smartssh.classes.sshinstance.ts} | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) rename ts/{smartssh.classes.ssh.ts => smartssh.classes.sshinstance.ts} (93%) diff --git a/ts/index.ts b/ts/index.ts index 7ae3ffd..d587c82 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1,7 +1,7 @@ import "typings-global" import * as plugins from "./smartssh.plugins"; -export {Ssh} from "./smartssh.classes.ssh"; +export {SshInstance} from "./smartssh.classes.sshinstance"; export {SshKey} from "./smartssh.classes.sshkey"; export {SshDir} from "./smartssh.classes.sshdir"; export {SshConfig} from "./smartssh.classes.sshconfig"; \ No newline at end of file diff --git a/ts/smartssh.classes.sshdir.ts b/ts/smartssh.classes.sshdir.ts index 7172f9f..03cc96d 100644 --- a/ts/smartssh.classes.sshdir.ts +++ b/ts/smartssh.classes.sshdir.ts @@ -4,9 +4,15 @@ import * as helpers from "./smartssh.classes.helpers"; import {SshKey} from "./smartssh.classes.sshkey"; import {SshConfig} from "./smartssh.classes.sshconfig"; export class SshDir { // sshDir class -> NOT EXPORTED, ONLY FOR INTERNAL USE - path:string; + path:string; // the path of the ssh directory constructor(sshDirPathArg:string){ - this.path = sshDirPathArg; + let sshDirPath:string; + if(sshDirPathArg){ + sshDirPath = sshDirPathArg; + } else { + sshDirPath = plugins.smartpath.home + } + this.path = sshDirPath; } sync(sshConfigArg:SshConfig,sshKeysArg:SshKey[]){ diff --git a/ts/smartssh.classes.ssh.ts b/ts/smartssh.classes.sshinstance.ts similarity index 93% rename from ts/smartssh.classes.ssh.ts rename to ts/smartssh.classes.sshinstance.ts index a5323b5..02cdc09 100644 --- a/ts/smartssh.classes.ssh.ts +++ b/ts/smartssh.classes.sshinstance.ts @@ -6,8 +6,8 @@ import {SshDir} from "./smartssh.classes.sshdir"; import {SshConfig} from "./smartssh.classes.sshconfig"; import {SshKey} from "./smartssh.classes.sshkey"; -export class Ssh { - private sshConfig:SshConfig; // points to sshConfig class instance +export class SshInstance { + private sshConfig:SshConfig; // sshConfig (e.g. represents ~/.ssh/config) private sshDir:SshDir; // points to sshDir class instance. private sshKeys:SshKey[]; //holds all ssh keys private sshSync:boolean; // if set to true, the ssh dir will be kept in sync automatically