pulumi/pkg/engine/config_get.go
Joe Duffy f6e694c72b Rename pulumi-fabric to pulumi
This includes a few changes:

* The repo name -- and hence the Go modules -- changes from pulumi-fabric to pulumi.

* The Node.js SDK package changes from @pulumi/pulumi-fabric to just pulumi.

* The CLI is renamed from lumi to pulumi.
2017-09-21 19:18:21 -07:00

27 lines
582 B
Go

// Copyright 2017, Pulumi Corporation. All rights reserved.
package engine
import (
"fmt"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/pkg/tokens"
)
func (eng *Engine) GetConfig(envName string, key tokens.ModuleMember) error {
info, err := eng.initEnvCmdName(tokens.QName(envName), "")
if err != nil {
return err
}
config := info.Target.Config
if config != nil {
if v, has := config[key]; has {
fmt.Fprintf(eng.Stdout, "%v\n", v)
return nil
}
}
return errors.Errorf("configuration key '%v' not found for environment '%v'", key, info.Target.Name)
}