add version commandline option
This commit is contained in:
@ -23,6 +23,7 @@ let command;
|
||||
let commandOption:string;
|
||||
|
||||
plugins.commander
|
||||
.version(npmciInfo.version)
|
||||
.arguments('<commandarg> [commandoptionarg]')
|
||||
.action(function (commandarg, commandoptionarg) {
|
||||
command = commandarg;
|
||||
|
@ -1,11 +1,24 @@
|
||||
import "typings-global";
|
||||
import * as plugins from "./npmci.plugins";
|
||||
|
||||
let sshRegex = /^(.*)\|?(.*)\|?(.*)/
|
||||
let sshInstance:plugins.smartssh.SshInstance;
|
||||
|
||||
export let ssh = () => {
|
||||
let sshInstance = new plugins.smartssh.SshInstance();
|
||||
sshInstance = new plugins.smartssh.SshInstance();
|
||||
plugins.smartparam.forEachMinimatch(process.env,"NPMCI_SSHKEY_*",evaluateSshkey);
|
||||
sshInstance.sync("to");
|
||||
};
|
||||
|
||||
export let evaluateSshkey = () => {
|
||||
export let evaluateSshkey = (sshkeyEnvVarArg) => {
|
||||
let resultArray = sshRegex.exec(sshkeyEnvVarArg);
|
||||
let sshKey = new plugins.smartssh.SshKey();
|
||||
|
||||
if(resultArray[1] && resultArray[1] != "undefined") sshKey.privateKeyBase64 = resultArray[1];
|
||||
let publicKey:string;
|
||||
if(resultArray[2] && resultArray[2] != "undefined") sshKey.publicKeyBase64 = resultArray[2];
|
||||
let host:string;
|
||||
if(resultArray[3] && resultArray[3] != "undefined") sshKey.host = resultArray[1];
|
||||
|
||||
sshInstance.addKey(sshKey);
|
||||
};
|
Reference in New Issue
Block a user