42 lines
2.6 KiB
JavaScript
42 lines
2.6 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
require("typings-global");
|
|
const plugins = require("./smartssh.plugins");
|
|
const helpers = require("./smartssh.classes.helpers");
|
|
class SshDir {
|
|
constructor(sshKeyArray, sshConfig, sshDirPathArg) {
|
|
this._sshKeyArray = sshKeyArray;
|
|
this._sshConfig = sshConfig;
|
|
if (sshDirPathArg) {
|
|
this._path = sshDirPathArg;
|
|
}
|
|
else {
|
|
this._path = plugins.path.join(plugins.smartpath.get.home(), '.ssh/');
|
|
}
|
|
;
|
|
}
|
|
writeToDir(dirPathArg) {
|
|
let path = this._path;
|
|
if (dirPathArg)
|
|
path = dirPathArg;
|
|
this._sshKeyArray.forEach((sshKeyArg) => {
|
|
sshKeyArg.store(path);
|
|
});
|
|
this._sshConfig.store(path);
|
|
}
|
|
;
|
|
readFromDir(dirPathArg) {
|
|
let path = this._path;
|
|
if (dirPathArg)
|
|
path = dirPathArg;
|
|
}
|
|
updateDirPath(dirPathArg) {
|
|
this._path = dirPathArg;
|
|
}
|
|
;
|
|
getKeys() {
|
|
return helpers.sshKeyArrayFromDir(this._path);
|
|
}
|
|
}
|
|
exports.SshDir = SshDir;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzc2guY2xhc3Nlcy5zc2hkaXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHNzaC5jbGFzc2VzLnNzaGRpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2Qiw4Q0FBNkM7QUFDN0Msc0RBQXFEO0FBSXJEO0lBSUksWUFBWSxXQUFxQixFQUFDLFNBQW9CLEVBQUMsYUFBc0I7UUFDekUsSUFBSSxDQUFDLFlBQVksR0FBRyxXQUFXLENBQUE7UUFDL0IsSUFBSSxDQUFDLFVBQVUsR0FBRy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