From be486ded27bf952cad7765fa0fd5af4799746eb2 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 13 Apr 2017 07:25:20 -0400 Subject: [PATCH] Added stderr redirect to /dev/null for env file reading command --- cli/cli.go | 2 +- common/init-exporter.spec | 5 ++++- export/export_test.go | 4 ++-- procfile/procfile.go | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 0cff70a..6fdb45a 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -30,7 +30,7 @@ import ( // App props const ( APP = "init-exporter" - VER = "0.12.1" + VER = "0.12.2" DESC = "Utility for exporting services described by Procfile to init system" ) diff --git a/common/init-exporter.spec b/common/init-exporter.spec index 80184f4..e8d92d3 100644 --- a/common/init-exporter.spec +++ b/common/init-exporter.spec @@ -42,7 +42,7 @@ Summary: Utility for exporting services described by Procfile to init system Name: init-exporter -Version: 0.12.1 +Version: 0.12.2 Release: 0%{?dist} Group: Development/Tools License: MIT @@ -132,6 +132,9 @@ rm -rf %{buildroot} ############################################################################### %changelog +* Thu Apr 13 2017 Anton Novojilov - 0.12.2-0 +- Added stderr redirect to /dev/null for env file reading command + * Mon Apr 10 2017 Anton Novojilov - 0.12.1-0 - Improved environment variables validation for support appending of variables diff --git a/export/export_test.go b/export/export_test.go index 306cc69..c51cb89 100644 --- a/export/export_test.go +++ b/export/export_test.go @@ -187,7 +187,7 @@ func (s *ExportSuite) TestUpstartExport(c *C) { c.Assert(service2Helper[4:], DeepEquals, []string{ "[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "", - "cd /srv/service/working-dir && exec env $(cat /srv/service/working-dir/shared/env.vars | xargs) /bin/echo 'service2'", + "cd /srv/service/working-dir && exec env $(cat /srv/service/working-dir/shared/env.vars 2>/dev/null | xargs) /bin/echo 'service2'", ""}, ) @@ -370,7 +370,7 @@ func (s *ExportSuite) TestSystemdExport(c *C) { c.Assert(service2Helper[4:], DeepEquals, []string{ "[[ -r /etc/profile.d/rbenv.sh ]] && source /etc/profile.d/rbenv.sh", "", - "exec env $(cat /srv/service/working-dir/shared/env.vars | xargs) /bin/echo 'service2'", + "exec env $(cat /srv/service/working-dir/shared/env.vars 2>/dev/null | xargs) /bin/echo 'service2'", ""}, ) diff --git a/procfile/procfile.go b/procfile/procfile.go index d1634a2..78e2d3c 100644 --- a/procfile/procfile.go +++ b/procfile/procfile.go @@ -187,7 +187,7 @@ func (s *Service) GetCommandExec(command string) string { if s.Options.IsEnvSet() { result += "env " + s.Options.EnvString() + " " } else if s.Options.IsEnvFileSet() { - result += "env $(cat " + s.Options.FullEnvFilePath() + " | xargs) " + result += "env $(cat " + s.Options.FullEnvFilePath() + " 2>/dev/null | xargs) " } switch command {