Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Consistent quoting for exports #254

Merged
merged 1 commit into from
Dec 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/chef-dk/command/shell_init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def run(argv)

env = omnibus_env.dup
path = env.delete("PATH")
msg("export PATH=#{path}")
msg("export PATH=\"#{path}\"")
env.each do |var_name, value|
msg("export #{var_name}=#{value}")
msg("export #{var_name}=\"#{value}\"")
end
0
end
Expand Down
2 changes: 1 addition & 1 deletion lib/chef-dk/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def omnibus_env
user_bin_dir = File.expand_path(File.join(Gem.user_dir, 'bin'))
{
'PATH' => [ omnibus_bin_dir, user_bin_dir, omnibus_embedded_bin_dir, ENV['PATH'] ].join(File::PATH_SEPARATOR),
'GEM_ROOT' => Gem.default_dir.inspect,
'GEM_ROOT' => Gem.default_dir,
'GEM_HOME' => Gem.user_dir,
'GEM_PATH' => Gem.path.join(':'),
}
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/command/exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def run_command

let(:expected_PATH) { [omnibus_bin_dir, user_bin_dir, omnibus_embedded_bin_dir, ENV['PATH']].join(File::PATH_SEPARATOR) }

let(:expected_GEM_ROOT) { Gem.default_dir.inspect }
let(:expected_GEM_ROOT) { Gem.default_dir }

let(:expected_GEM_HOME) { Gem.user_dir }

Expand Down Expand Up @@ -110,7 +110,7 @@ def run_command

let(:expected_PATH) { [omnibus_bin_dir, user_bin_dir, omnibus_embedded_bin_dir, ENV['PATH']].join(File::PATH_SEPARATOR) }

let(:expected_GEM_ROOT) { Gem.default_dir.inspect }
let(:expected_GEM_ROOT) { Gem.default_dir }

let(:expected_GEM_HOME) { Gem.user_dir }

Expand Down
6 changes: 3 additions & 3 deletions spec/unit/command/shell_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@

let(:expected_environment_commands) do
<<-EOH
export PATH=#{expected_path}
export PATH="#{expected_path}"
export GEM_ROOT="#{expected_gem_root}"
export GEM_HOME=#{expected_gem_home}
export GEM_PATH=#{expected_gem_path}
export GEM_HOME="#{expected_gem_home}"
export GEM_PATH="#{expected_gem_path}"
EOH
end

Expand Down