command/push: properly copy the data directory no matter what

This commit is contained in:
Mitchell Hashimoto 2015-03-05 23:10:28 -08:00
parent 22087181af
commit a1b424d53f
2 changed files with 9 additions and 3 deletions

View File

@ -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.

View File

@ -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)
}