From 955a43a14dfb232701650c95ebf5094c6fc9709c Mon Sep 17 00:00:00 2001 From: Vojta Bartos Date: Fri, 5 Jun 2015 10:11:04 +0200 Subject: [PATCH 1/2] Fix bug where we want to set custom shell - at container details sub header - tried to access to array like object - added reduce function to make array object --- src/components/ContainerDetailsSubheader.react.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ContainerDetailsSubheader.react.js b/src/components/ContainerDetailsSubheader.react.js index bc9d4a34..c34ccd6d 100644 --- a/src/components/ContainerDetailsSubheader.react.js +++ b/src/components/ContainerDetailsSubheader.react.js @@ -102,7 +102,11 @@ var ContainerDetailsSubheader = React.createClass({ if (!this.disableTerminal()) { metrics.track('Terminaled Into Container'); var container = this.props.container; - var shell = ContainerUtil.env(container).SHELL; + var shell = ContainerUtil.env(container).reduce((envs, env) => { + envs[env[0]] = env[1]; + return envs; + }, {}).SHELL; + if(typeof shell === 'undefined') { shell = 'sh'; } From 4b708f2275ad48ed17c6d5c26e1a406fdfe0f07f Mon Sep 17 00:00:00 2001 From: Vojta Bartos Date: Fri, 5 Jun 2015 19:49:18 +0200 Subject: [PATCH 2/2] Making condition simple - removed checking for undefined, not necessary --- src/components/ContainerDetailsSubheader.react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ContainerDetailsSubheader.react.js b/src/components/ContainerDetailsSubheader.react.js index c34ccd6d..72f2f9d1 100644 --- a/src/components/ContainerDetailsSubheader.react.js +++ b/src/components/ContainerDetailsSubheader.react.js @@ -107,7 +107,7 @@ var ContainerDetailsSubheader = React.createClass({ return envs; }, {}).SHELL; - if(typeof shell === 'undefined') { + if(!shell) { shell = 'sh'; } machine.ip().then(ip => {