From 741ac64c6128e5b6941b91e22f9ad9f8203467f2 Mon Sep 17 00:00:00 2001 From: max furman Date: Thu, 5 Aug 2021 14:00:58 -0700 Subject: [PATCH] change name of package cli-utils/config to cli-utils/step --- ca/identity/identity.go | 10 +++++----- go.mod | 11 +++++++---- templates/templates.go | 8 ++++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ca/identity/identity.go b/ca/identity/identity.go index 0f022dd7..14a22eb9 100644 --- a/ca/identity/identity.go +++ b/ca/identity/identity.go @@ -16,7 +16,7 @@ import ( "github.com/pkg/errors" "github.com/smallstep/certificates/api" - "go.step.sm/cli-utils/config" + "go.step.sm/cli-utils/step" "go.step.sm/crypto/pemutil" ) @@ -40,10 +40,10 @@ const TunnelTLS Type = "tTLS" const DefaultLeeway = 1 * time.Minute // IdentityFile contains the location of the identity file. -var IdentityFile = filepath.Join(config.StepPath(), "config", "identity.json") +var IdentityFile = filepath.Join(step.Path(), "config", "identity.json") // DefaultsFile contains the location of the defaults file. -var DefaultsFile = filepath.Join(config.StepPath(), "config", "defaults.json") +var DefaultsFile = filepath.Join(step.Path(), "config", "defaults.json") // Identity represents the identity file that can be used to authenticate with // the CA. @@ -80,8 +80,8 @@ func LoadDefaultIdentity() (*Identity, error) { // configDir and identityDir are used in WriteDefaultIdentity for testing // purposes. var ( - configDir = filepath.Join(config.StepPath(), "config") - identityDir = filepath.Join(config.StepPath(), "identity") + configDir = filepath.Join(step.Path(), "config") + identityDir = filepath.Join(step.Path(), "identity") ) // WriteDefaultIdentity writes the given certificates and key and the diff --git a/go.mod b/go.mod index 5f234b7a..3b7c0f3a 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,10 @@ require ( gopkg.in/square/go-jose.v2 v2.6.0 ) -// replace github.com/smallstep/nosql => ../nosql -// replace go.step.sm/crypto => ../crypto -// replace go.step.sm/cli-utils => ../cli-utils -// replace go.step.sm/linkedca => ../linkedca +//replace github.com/smallstep/nosql => ../nosql + +//replace go.step.sm/crypto => ../crypto + +replace go.step.sm/cli-utils => ../cli-utils + +replace go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 => github.com/omorsi/pkcs7 v0.0.0-20210217142924-a7b80a2a8568 diff --git a/templates/templates.go b/templates/templates.go index 09416b68..4fb831d4 100644 --- a/templates/templates.go +++ b/templates/templates.go @@ -10,8 +10,8 @@ import ( "github.com/Masterminds/sprig/v3" "github.com/pkg/errors" - "go.step.sm/cli-utils/config" "go.step.sm/cli-utils/fileutil" + "go.step.sm/cli-utils/step" ) // TemplateType defines how a template will be written in disk. @@ -132,7 +132,7 @@ func (t *Template) Validate() error { if t.TemplatePath != "" { // Check for file - st, err := os.Stat(config.StepAbs(t.TemplatePath)) + st, err := os.Stat(step.Abs(t.TemplatePath)) if err != nil { return errors.Wrapf(err, "error reading %s", t.TemplatePath) } @@ -166,7 +166,7 @@ func (t *Template) Load() error { if t.Template == nil && t.Type != Directory { switch { case t.TemplatePath != "": - filename := config.StepAbs(t.TemplatePath) + filename := step.Abs(t.TemplatePath) b, err := ioutil.ReadFile(filename) if err != nil { return errors.Wrapf(err, "error reading %s", filename) @@ -247,7 +247,7 @@ type Output struct { // Write writes the Output to the filesystem as a directory, file or snippet. func (o *Output) Write() error { - path := config.StepAbs(o.Path) + path := step.Abs(o.Path) if o.Type == Directory { return mkdir(path, 0700) }