mirror of https://github.com/hashicorp/terraform
This still isn't ready. But this gets tests passing and compilation workingpull/6597/head
parent
9ddf73ad81
commit
f34ef1f92a
@ -0,0 +1,22 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// testStateBackups returns the list of backups in order of creation
|
||||
// (oldest first) in the given directory.
|
||||
func testStateBackups(t *testing.T, dir string) []string {
|
||||
// Find all the backups
|
||||
list, err := filepath.Glob(filepath.Join(dir, "*"+DefaultBackupExtension))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
// Sort them which will put them naturally in the right order
|
||||
sort.Strings(list)
|
||||
|
||||
return list
|
||||
}
|
||||
Loading…
Reference in new issue