mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
command: disable backup with "-" [GH-1072]
/cc @phinze
This commit is contained in:
parent
80c129a961
commit
8e76a02a56
@ -1113,6 +1113,12 @@ func TestApply_disableBackup(t *testing.T) {
|
||||
if err == nil || !os.IsNotExist(err) {
|
||||
t.Fatalf("backup should not exist")
|
||||
}
|
||||
|
||||
// Ensure there is no literal "-"
|
||||
_, err = os.Stat("-")
|
||||
if err == nil || !os.IsNotExist(err) {
|
||||
t.Fatalf("backup should not exist")
|
||||
}
|
||||
}
|
||||
|
||||
func testHttpServer(t *testing.T) net.Listener {
|
||||
|
@ -154,9 +154,11 @@ func State(opts *StateOpts) (*StateResult, error) {
|
||||
backupPath = opts.BackupPath
|
||||
}
|
||||
|
||||
result.State = &state.BackupState{
|
||||
Real: result.State,
|
||||
Path: backupPath,
|
||||
if backupPath != "-" {
|
||||
result.State = &state.BackupState{
|
||||
Real: result.State,
|
||||
Path: backupPath,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user