Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
062f3ad060 | |||
ecd0fd8fad | |||
742bf694e4 | |||
38165f11db |
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ docs/
|
||||
ts/typings/
|
||||
ts/*.js
|
||||
ts/*.js.map
|
||||
test/temp/
|
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM hosttoday/ht-docker-node:npmts
|
||||
COPY ./ /node-app
|
||||
WORKDIR /node-app
|
||||
RUN npm install
|
||||
RUN npmts
|
2
dist/smartssh.classes.sshkey.d.ts
vendored
2
dist/smartssh.classes.sshkey.d.ts
vendored
@ -18,5 +18,5 @@ export declare class SshKey {
|
||||
authorized: boolean;
|
||||
type: any;
|
||||
read(filePathArg: any): void;
|
||||
store(dirPathArg?: string): void;
|
||||
store(dirPathArg: string): void;
|
||||
}
|
||||
|
10
dist/smartssh.classes.sshkey.js
vendored
10
dist/smartssh.classes.sshkey.js
vendored
File diff suppressed because one or more lines are too long
1
dist/smartssh.plugins.d.ts
vendored
1
dist/smartssh.plugins.d.ts
vendored
@ -5,5 +5,6 @@ export declare let fs: any;
|
||||
export declare let minimatch: any;
|
||||
export import path = require("path");
|
||||
export declare let q: any;
|
||||
export declare let shelljs: any;
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartpath = require("smartpath");
|
||||
|
3
dist/smartssh.plugins.js
vendored
3
dist/smartssh.plugins.js
vendored
@ -6,7 +6,8 @@ exports.fs = require("fs-extra");
|
||||
exports.minimatch = require("minimatch");
|
||||
exports.path = require("path");
|
||||
exports.q = require("q");
|
||||
exports.shelljs = require("shelljs");
|
||||
exports.smartfile = require("smartfile");
|
||||
exports.smartpath = require("smartpath");
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3NoLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5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b3J0IGxldCBzaGVsbGpzID0gcmVxdWlyZShcInNoZWxsanNcIik7XG5leHBvcnQgaW1wb3J0IHNtYXJ0ZmlsZSA9IHJlcXVpcmUoXCJzbWFydGZpbGVcIik7XG5leHBvcnQgaW1wb3J0IHNtYXJ0cGF0aCA9IHJlcXVpcmUoXCJzbWFydHBhdGhcIik7Il19
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "smartssh",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.4",
|
||||
"description": "setups SSH quickly and in a painless manner",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
@ -28,6 +28,7 @@
|
||||
"js-base64": "^2.1.9",
|
||||
"minimatch": "^3.0.2",
|
||||
"q": "^1.4.1",
|
||||
"shelljs": "^0.7.0",
|
||||
"smartfile": "^4.0.5",
|
||||
"smartpath": "^3.2.2",
|
||||
"typings-global": "^1.0.3",
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,7 @@
|
||||
import "typings-test"
|
||||
import "should";
|
||||
import smartssh = require("../dist/index");
|
||||
import path = require("path");
|
||||
describe("smartssh",function(){
|
||||
let testSshInstance:smartssh.SshInstance;
|
||||
let testSshKey:smartssh.SshKey;
|
||||
@ -24,6 +25,9 @@ describe("smartssh",function(){
|
||||
});
|
||||
it(".publicKeyBase64 should be public key base 64 encoded",function(){
|
||||
testSshKey.pubKeyBase64;
|
||||
});
|
||||
it(".store() should store the file to disk",function(){
|
||||
testSshKey.store(path.join(process.cwd(),"test/temp"));
|
||||
})
|
||||
});
|
||||
describe(".SshInstance",function(){
|
||||
|
@ -77,14 +77,18 @@ export class SshKey {
|
||||
read(filePathArg){
|
||||
|
||||
}
|
||||
store(dirPathArg?:string){
|
||||
store(dirPathArg:string){
|
||||
plugins.fs.ensureDirSync(dirPathArg);
|
||||
let fileNameBase = this.host;
|
||||
if(this._privKey){
|
||||
plugins.smartfile.memory.toFsSync(this._privKey,plugins.path.join(dirPathArg,fileNameBase));
|
||||
let filePath = plugins.path.join(dirPathArg,fileNameBase);
|
||||
plugins.smartfile.memory.toFsSync(this._privKey,filePath);
|
||||
plugins.shelljs.chmod(600,filePath);
|
||||
};
|
||||
if (this._pubKey){
|
||||
plugins.smartfile.memory.toFsSync(this._pubKey,plugins.path.join(dirPathArg,fileNameBase + ".pub"));
|
||||
let filePath = plugins.path.join(dirPathArg,fileNameBase + ".pub");
|
||||
plugins.smartfile.memory.toFsSync(this._pubKey,filePath);
|
||||
plugins.shelljs.chmod(600,filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,5 +5,6 @@ export let fs = require("fs-extra");
|
||||
export let minimatch = require("minimatch");
|
||||
export import path = require("path");
|
||||
export let q = require("q");
|
||||
export let shelljs = require("shelljs");
|
||||
export import smartfile = require("smartfile");
|
||||
export import smartpath = require("smartpath");
|
Reference in New Issue
Block a user