Skip to content

Commit

Permalink
Added stderr redirect to /dev/null for env file reading command
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Apr 13, 2017
1 parent 88599e0 commit be486de
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
5 changes: 4 additions & 1 deletion common/init-exporter.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -132,6 +132,9 @@ rm -rf %{buildroot}
###############################################################################

%changelog
* Thu Apr 13 2017 Anton Novojilov <[email protected]> - 0.12.2-0
- Added stderr redirect to /dev/null for env file reading command

* Mon Apr 10 2017 Anton Novojilov <[email protected]> - 0.12.1-0
- Improved environment variables validation for support appending of variables

Expand Down
4 changes: 2 additions & 2 deletions export/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
""},
)

Expand Down Expand Up @@ -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'",
""},
)

Expand Down
2 changes: 1 addition & 1 deletion procfile/procfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit be486de

Please sign in to comment.