39 lines
2.6 KiB
JavaScript
39 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzc2guY2xhc3Nlcy5zc2hkaXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHNzaC5jbGFzc2VzLnNzaGRpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2Qiw4Q0FBNkM7QUFDN0Msc0RBQXFEO0FBS3JEO0lBSUUsWUFBYSxXQUFxQixFQUFFLFNBQW9CLEVBQUUsYUFBc0I7UUFDOUUsSUFBSSxDQUFDLFlBQVksR0FBRyxXQUFXLENBQUE7UUFDL0IsSUFBSSxDQUFDLFVBQVUsR0FBRyxTQUFTLENBQUE7UUF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