From 4827d33ca13cbdbf1c34fd651b97ea088ef99f8b Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Wed, 24 Aug 2016 15:30:29 +1200 Subject: [PATCH] feat(templates): support env variables with default value (#161) --- app/components/templates/templates.html | 4 ++-- app/components/templates/templatesController.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/components/templates/templates.html b/app/components/templates/templates.html index b3af46c04..fb756ed31 100644 --- a/app/components/templates/templates.html +++ b/app/components/templates/templates.html @@ -55,8 +55,8 @@
- -
+ +
diff --git a/app/components/templates/templatesController.js b/app/components/templates/templatesController.js index 25b69d5c9..753cbc318 100644 --- a/app/components/templates/templatesController.js +++ b/app/components/templates/templatesController.js @@ -72,8 +72,9 @@ function createConfigFromTemplate(template) { }; if (template.env) { template.env.forEach(function (v) { - if (v.value) { - containerConfig.Env.push(v.name + "=" + v.value); + if (v.value || v.default) { + var val = v.default ? v.default : v.value; + containerConfig.Env.push(v.name + "=" + val); } }); }