2016-05-31 17:00:52 +00:00
|
|
|
import "typings-global";
|
|
|
|
import * as plugins from "./smartssh.plugins";
|
|
|
|
import * as helpers from "./smartssh.classes.helpers";
|
2016-06-01 00:31:29 +00:00
|
|
|
import {SshInstance} from "./smartssh.classes.sshinstance";
|
2016-05-31 17:16:45 +00:00
|
|
|
import {SshKey} from "./smartssh.classes.sshkey";
|
|
|
|
import {SshConfig} from "./smartssh.classes.sshconfig";
|
|
|
|
export class SshDir { // sshDir class -> NOT EXPORTED, ONLY FOR INTERNAL USE
|
2016-05-31 22:56:24 +00:00
|
|
|
path:string; // the path of the ssh directory
|
2016-06-01 01:57:17 +00:00
|
|
|
sshInstance:SshInstance;
|
|
|
|
constructor(sshInstanceArg:SshInstance,sshDirPathArg?:string){
|
2016-05-31 22:56:24 +00:00
|
|
|
let sshDirPath:string;
|
|
|
|
if(sshDirPathArg){
|
|
|
|
sshDirPath = sshDirPathArg;
|
|
|
|
} else {
|
2016-06-01 00:31:29 +00:00
|
|
|
sshDirPath = plugins.smartpath.get.home();
|
2016-05-31 22:56:24 +00:00
|
|
|
}
|
|
|
|
this.path = sshDirPath;
|
2016-05-31 17:00:52 +00:00
|
|
|
}
|
2016-06-24 00:49:55 +00:00
|
|
|
writeToDir(){ // syncs sshInstance to directory
|
2016-05-31 17:00:52 +00:00
|
|
|
|
|
|
|
};
|
2016-06-24 00:49:55 +00:00
|
|
|
readFromDir(){ // syncs sshInstance from directory
|
2016-06-01 00:31:29 +00:00
|
|
|
|
|
|
|
}
|
2016-05-31 17:00:52 +00:00
|
|
|
getKeys(){
|
|
|
|
return helpers.sshKeyArrayFromDir(this.path);
|
|
|
|
}
|
|
|
|
}
|