change name of package cli-utils/config to cli-utils/step

This commit is contained in:
max furman 2021-08-05 14:00:58 -07:00
parent 62a20c7db5
commit 741ac64c61
3 changed files with 16 additions and 13 deletions

View file

@ -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

11
go.mod
View file

@ -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

View file

@ -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)
}