some restructuring

This commit is contained in:
2016-06-14 00:27:55 +02:00
parent e5bdfff743
commit 201d5cc6d7
11 changed files with 22 additions and 19 deletions

View File

@ -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(){

View File

@ -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;
};

View File

@ -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
}
}
}

View File

@ -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");