Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't shell parse config values #39

Merged
merged 1 commit into from
Jan 19, 2021
Merged
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
Don't shell parse config values
* Resolves #38

Signed-off-by: Emily Casey <[email protected]>
ekcasey committed Jan 19, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5d42f40801a47d5715ee9a5844f416578e0f2748
7 changes: 1 addition & 6 deletions buildpack.go
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/buildpacks/libcnb"
"github.com/heroku/color"
"github.com/mattn/go-shellwords"

"github.com/paketo-buildpacks/libpak/bard"
)
@@ -277,15 +276,11 @@ func NewConfigurationResolver(buildpack libcnb.Buildpack, logger *bard.Logger) (

for _, c := range md.Configurations {
s, _ := cr.Resolve(c.Name)
p, err := shellwords.Parse(s)
if err != nil {
return ConfigurationResolver{}, fmt.Errorf("unable to parse value\n%w", err)
}

e := configurationEntry{
Name: c.Name,
Description: c.Description,
Value: strings.Join(p, " "),
Value: s,
}

if l := len(e.Name); l > nameLength {
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ require (
github.com/creack/pty v1.1.11
github.com/heroku/color v0.0.6
github.com/imdario/mergo v0.3.11
github.com/mattn/go-shellwords v1.0.11
github.com/onsi/gomega v1.10.4
github.com/pelletier/go-toml v1.8.1
github.com/sclevine/spec v1.4.0
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -32,8 +32,6 @@ github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-shellwords v1.0.11 h1:vCoR9VPpsk/TZFW2JwK5I9S0xdrtUq2bph6/YjEPnaw=
github.com/mattn/go-shellwords v1.0.11/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=