lib/chef-cli/command/shell_init.rb in chef-cli-1.0.3 vs lib/chef-cli/command/shell_init.rb in chef-cli-1.0.6
- old
+ new
@@ -94,11 +94,11 @@
err("Please specify what shell you are using\n")
err(opt_parser.to_s)
return 1
elsif !SUPPORTED_SHELLS.include?(shell_name)
err("Shell `#{shell_name}' is not currently supported")
- err("Supported shells are: #{SUPPORTED_SHELLS.join(' ')}")
+ err("Supported shells are: #{SUPPORTED_SHELLS.join(" ")}")
return 1
end
env = omnibus_env.dup
path = env.delete("PATH")
@@ -115,10 +115,11 @@
msg(cmd) unless cmd.empty?
end
def completion_for(shell)
return "" unless (completion_template_basename = completion_template_for(shell))
+
completion_template_path = expand_completion_template_path(completion_template_basename)
erb = ERB.new(File.read(completion_template_path), nil, "-")
context_binding = shell_completion_template_context.get_binding
erb.result(context_binding)
end
@@ -164,10 +165,10 @@
# Fish's syntax for setting PATH is special. Path elements are
# divided by spaces (instead of colons). We also send STDERR to
# /dev/null to avoid Fish's helpful warnings about nonexistent
# PATH elements.
if var == "PATH"
- emit_shell_cmd(%Q{set -gx #{var} "#{val.split(':').join('" "')}" 2>/dev/null;})
+ emit_shell_cmd(%Q{set -gx #{var} "#{val.split(":").join('" "')}" 2>/dev/null;})
else
emit_shell_cmd(%Q{set -gx #{var} "#{val}";})
end
end