add removeKey and replaceKey methods
This commit is contained in:
parent
1663d9a266
commit
1d17dd1b84
@ -3,6 +3,10 @@ import plugins = require("./smartssh.plugins");
|
|||||||
import classes = require("./smartssh.classes");
|
import classes = require("./smartssh.classes");
|
||||||
|
|
||||||
export let sshKeyArrayFromDir = function(dirArg:string):classes.sshKey[]{
|
export let sshKeyArrayFromDir = function(dirArg:string):classes.sshKey[]{
|
||||||
let sshKeyArray = [];
|
let sshKeyArray = []; //TODO
|
||||||
return sshKeyArray;
|
return sshKeyArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export let getKeyIndex = function(hostArg:string){
|
||||||
|
return 0; //TODO
|
||||||
|
}
|
@ -26,6 +26,14 @@ export class ssh {
|
|||||||
return undefined;
|
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(){
|
sync(){
|
||||||
this.sshDir.sync(this.sshConfig,this.sshKeys); //call sync method of sshDir class;
|
this.sshDir.sync(this.sshConfig,this.sshKeys); //call sync method of sshDir class;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user