command/push: properly copy the data directory no matter what
This commit is contained in:
parent
22087181af
commit
a1b424d53f
|
@ -95,8 +95,10 @@ func (c *PushCommand) Run(args []string) int {
|
|||
// Build the archiving options, which includes everything it can
|
||||
// by default according to VCS rules but forcing the data directory.
|
||||
archiveOpts := &archive.ArchiveOpts{
|
||||
Include: []string{filepath.Join(c.DataDir())},
|
||||
VCS: true,
|
||||
VCS: true,
|
||||
Extra: map[string]string{
|
||||
DefaultDataDir: c.DataDir(),
|
||||
},
|
||||
}
|
||||
if !moduleLock {
|
||||
// If we're not locking modules, then exclude the modules dir.
|
||||
|
|
|
@ -50,7 +50,11 @@ func TestPush_good(t *testing.T) {
|
|||
}
|
||||
|
||||
actual := testArchiveStr(t, archivePath)
|
||||
expected := []string{}
|
||||
expected := []string{
|
||||
".terraform/",
|
||||
".terraform/terraform.tfstate",
|
||||
"main.tf",
|
||||
}
|
||||
if !reflect.DeepEqual(actual, expected) {
|
||||
t.Fatalf("bad: %#v", actual)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue