mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
command: Meta provides the state output path
This commit is contained in:
parent
0c9436f37b
commit
0fb87e499d
@ -215,7 +215,7 @@ func (c *ApplyCommand) Run(args []string) int {
|
|||||||
"infrastructure, so keep it safe. To inspect the complete state\n"+
|
"infrastructure, so keep it safe. To inspect the complete state\n"+
|
||||||
"use the `terraform show` command.\n\n"+
|
"use the `terraform show` command.\n\n"+
|
||||||
"State path: %s",
|
"State path: %s",
|
||||||
c.Meta.stateOutPath)))
|
c.Meta.StateOutPath())))
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have outputs, then output those at the end.
|
// If we have outputs, then output those at the end.
|
||||||
|
@ -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.
|
// Colorize returns the colorization structure for a command.
|
||||||
func (m *Meta) Colorize() *colorstring.Colorize {
|
func (m *Meta) Colorize() *colorstring.Colorize {
|
||||||
return &colorstring.Colorize{
|
return &colorstring.Colorize{
|
||||||
|
Loading…
Reference in New Issue
Block a user