now handling docker env strings allright
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import git = require("./smartstring.git");
|
||||
import SmartstringGit = require("./smartstring.git");
|
||||
import SmartstringDocker = require("./smartstring.docker");
|
||||
|
||||
let smartstring = {
|
||||
git : git
|
||||
git : SmartstringGit,
|
||||
docker: SmartstringDocker
|
||||
};
|
||||
|
||||
export = smartstring;
|
17
ts/smartstring.docker.ts
Normal file
17
ts/smartstring.docker.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./smartstring.plugins");
|
||||
|
||||
/**
|
||||
* converts an erray of env strings from docker remote api to an usable object.
|
||||
* @param envArrayArg
|
||||
* @returns {}
|
||||
*/
|
||||
export let makeEnvObject = function(envArrayArg:string[]){
|
||||
let returnObject = {};
|
||||
let regexString = /(.*)=(.*)/;
|
||||
for(let envKey in envArrayArg){
|
||||
let regexMatches = regexString.exec(envArrayArg[envKey]);
|
||||
returnObject[regexMatches[1]] = regexMatches[2];
|
||||
};
|
||||
return returnObject;
|
||||
};
|
Reference in New Issue
Block a user