diff --git a/ts/smartssh.classes.helpers.ts b/ts/smartssh.classes.helpers.ts index 887dbaf..b6d580e 100644 --- a/ts/smartssh.classes.helpers.ts +++ b/ts/smartssh.classes.helpers.ts @@ -3,6 +3,10 @@ import plugins = require("./smartssh.plugins"); import classes = require("./smartssh.classes"); export let sshKeyArrayFromDir = function(dirArg:string):classes.sshKey[]{ - let sshKeyArray = []; + let sshKeyArray = []; //TODO return sshKeyArray; +} + +export let getKeyIndex = function(hostArg:string){ + return 0; //TODO } \ No newline at end of file diff --git a/ts/smartssh.classes.ts b/ts/smartssh.classes.ts index ecadd8b..a8b36d4 100644 --- a/ts/smartssh.classes.ts +++ b/ts/smartssh.classes.ts @@ -26,6 +26,14 @@ export class ssh { return undefined; } }; + removeKey(sshKeyArg:sshKey){ + let keyIndex = helpers.getKeyIndex(sshKeyArg.host); + this.sshKeys.splice(keyIndex,1); + }; + replaceKey(sshKeyOldArg:sshKey,sshKeyNewArg:sshKey){ + let keyIndex = helpers.getKeyIndex(sshKeyOldArg.host); + this.sshKeys.splice(keyIndex,1,sshKeyNewArg); + }; sync(){ this.sshDir.sync(this.sshConfig,this.sshKeys); //call sync method of sshDir class; };