Skip to content

Commit

Permalink
Merge pull request #39 from paketo-buildpacks/no-shellword-parse
Browse files Browse the repository at this point in the history
Don't shell parse config values
  • Loading branch information
ekcasey authored Jan 19, 2021
2 parents 62512c4 + 5d42f40 commit 6551384
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
7 changes: 1 addition & 6 deletions buildpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 6551384

Please sign in to comment.