From 5d42f40801a47d5715ee9a5844f416578e0f2748 Mon Sep 17 00:00:00 2001 From: Emily Casey Date: Tue, 19 Jan 2021 11:22:33 -0500 Subject: [PATCH] Don't shell parse config values * Resolves #38 Signed-off-by: Emily Casey --- buildpack.go | 7 +------ go.mod | 1 - go.sum | 2 -- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/buildpack.go b/buildpack.go index 4391438..d35b247 100644 --- a/buildpack.go +++ b/buildpack.go @@ -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 { diff --git a/go.mod b/go.mod index dc561eb..7950fec 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index bedaea2..1ee1b02 100644 --- a/go.sum +++ b/go.sum @@ -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=