command: Meta provides the state output path

This commit is contained in:
Armon Dadgar 2014-10-11 18:34:11 -07:00 committed by Mitchell Hashimoto
parent 0c9436f37b
commit 0fb87e499d
2 changed files with 11 additions and 1 deletions

View File

@ -215,7 +215,7 @@ func (c *ApplyCommand) Run(args []string) int {
"infrastructure, so keep it safe. To inspect the complete state\n"+
"use the `terraform show` command.\n\n"+
"State path: %s",
c.Meta.stateOutPath)))
c.Meta.StateOutPath())))
}
// If we have outputs, then output those at the end.

View File

@ -76,6 +76,16 @@ func (m *Meta) initStatePaths() {
}
}
// StateOutPath returns the true output path for the state file
func (m *Meta) StateOutPath() string {
m.initStatePaths()
if m.useRemoteState {
path, _ := remote.HiddenStatePath()
return path
}
return m.stateOutPath
}
// Colorize returns the colorization structure for a command.
func (m *Meta) Colorize() *colorstring.Colorize {
return &colorstring.Colorize{