Skip to content

Commit

Permalink
Merge pull request #967 from heroku/schneems/quote-export-file
Browse files Browse the repository at this point in the history
[changelog skip] Quote buildpack's `export` values
  • Loading branch information
schneems committed Mar 19, 2020
2 parents 2018053 + 211624d commit be6cd5f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/language_pack/base.rb
Expand Up @@ -253,9 +253,9 @@ def export(key, val, layer: nil, option: nil)
else
string =
if option == :default
"export #{key}=${#{key}:-#{val}}"
%{export #{key}="${#{key}:-#{val}}"}
elsif option == :path
"export #{key}=#{val}:$#{key}"
%{export #{key}="#{val}:$#{key}"}
else
%{export #{key}="#{val.gsub('"','\"')}"}
end
Expand Down
15 changes: 15 additions & 0 deletions spec/hatchet/buildpack_spec.rb
@@ -0,0 +1,15 @@
require_relative '../spec_helper'

describe "Buildpack internals" do
it "handles PATH with a newline in it correctly" do
buildpacks = [
"https://github.com/sharpstone/export_path_with_newlines_buildpack",
Hatchet::App.default_buildpack,
"https://github.com/heroku/null-buildpack"
]
Hatchet::Runner.new("default_ruby", buildpacks: buildpacks).deploy do |app|
expect(app.output).to_not match("No such file or directory")
end
end
end

0 comments on commit be6cd5f

Please sign in to comment.