some restructuring
This commit is contained in:
@ -16,10 +16,10 @@ export class SshDir { // sshDir class -> NOT EXPORTED, ONLY FOR INTERNAL USE
|
||||
}
|
||||
this.path = sshDirPath;
|
||||
}
|
||||
syncToDir(){ //syncs
|
||||
syncToDir(){ // syncs sshInstance to directory
|
||||
|
||||
};
|
||||
syncFromDir(){
|
||||
syncFromDir(){ // syncs sshInstance from directory
|
||||
|
||||
}
|
||||
getKeys(){
|
||||
|
@ -9,13 +9,12 @@ import {SshKey} from "./smartssh.classes.sshkey";
|
||||
export class SshInstance {
|
||||
private sshConfig:SshConfig; // sshConfig (e.g. represents ~/.ssh/config)
|
||||
private sshDir:SshDir; // points to sshDir class instance.
|
||||
private sshKeyArray:SshKey[]; //holds all ssh keys
|
||||
protected sshKeyArray:SshKey[]; //holds all ssh keys
|
||||
private sshSync:boolean; // if set to true, the ssh dir will be kept in sync automatically
|
||||
constructor(optionsArg:{sshDirPath?:string,sshSync?:boolean}={}){
|
||||
optionsArg ? void(0) : optionsArg = {};
|
||||
|
||||
this.sshDir = new SshDir(this,optionsArg.sshDirPath);
|
||||
this.sshKeyArray = this.sshDir.getKeys();
|
||||
this.sshKeyArray = [];
|
||||
this.sshSync = optionsArg.sshSync;
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,7 @@ export class SshKey {
|
||||
} else { //we assume we are given a directory as filePathArg, so we store the whole key
|
||||
plugins.fs.ensureDirSync(filePathObj.dir);
|
||||
this.store(plugins.path.join(filePathObj.dir,"key.priv")); // call this function recursivly
|
||||
this.store(plugins.path.join(filePathObj.dir,"key.priv")); // call this function recursivly
|
||||
this.store(plugins.path.join(filePathObj.dir,"key.pub")); // call this function recursivly
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
import "typings-global"
|
||||
export let beautylog = require("beautylog");
|
||||
export import beautylog = require("beautylog");
|
||||
export let base64 = require("js-base64").Base64;
|
||||
export let fs = require("fs-extra");
|
||||
export let path = require("path");
|
||||
export let smartfile = require("smartfile");
|
||||
export let minimatch = require("minimatch");
|
||||
export import path = require("path");
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartpath = require("smartpath");
|
Reference in New Issue
Block a user