now handling docker env strings allright

This commit is contained in:
2016-04-16 00:58:44 +02:00
parent f62c74a064
commit 4c42bab6b9
10 changed files with 76 additions and 13 deletions

View File

@ -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
View 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;
};