mirror of
https://github.com/foomo/posh-providers.git
synced 2025-10-16 12:35:41 +00:00
feat: support for specifying a space environment when creating a client
This commit is contained in:
parent
5834ea1703
commit
2e5a02b246
@ -145,8 +145,14 @@ func (c *Command) execute(ctx context.Context, r *readline.Readline) error {
|
|||||||
return errors.Wrap(err, string(out))
|
return errors.Wrap(err, string(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "master" is the built-in default environment name of contentful
|
||||||
|
// fallback to it if the configuration does not ask specifically for an environment
|
||||||
|
if cfg.Environment == "" {
|
||||||
|
cfg.Environment = "master"
|
||||||
|
}
|
||||||
|
|
||||||
if err := shell.New(ctx, c.l, "gocontentful",
|
if err := shell.New(ctx, c.l, "gocontentful",
|
||||||
"-spaceid", cfg.SpaceID, "-cmakey", cfg.CMAKey,
|
"-spaceid", cfg.SpaceID, "-cmakey", cfg.CMAKey, "-environment", cfg.Environment,
|
||||||
"-contenttypes", strings.Join(cfg.ContentTypes, ","), dir).
|
"-contenttypes", strings.Join(cfg.ContentTypes, ","), dir).
|
||||||
Args(r.AdditionalArgs()...).
|
Args(r.AdditionalArgs()...).
|
||||||
Run(); err != nil {
|
Run(); err != nil {
|
||||||
|
|||||||
@ -3,5 +3,6 @@ package gocontentful
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
SpaceID string `yaml:"spaceId"`
|
SpaceID string `yaml:"spaceId"`
|
||||||
CMAKey string `yaml:"cmaKey"`
|
CMAKey string `yaml:"cmaKey"`
|
||||||
|
Environment string `yaml:"environment,omitempty"`
|
||||||
ContentTypes []string `yaml:"contentTypes"`
|
ContentTypes []string `yaml:"contentTypes"`
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user