From a1b424d53f60857ca7984e3e674fb40949830136 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 5 Mar 2015 23:10:28 -0800 Subject: [PATCH] command/push: properly copy the data directory no matter what --- command/push.go | 6 ++++-- command/push_test.go | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/command/push.go b/command/push.go index 98ad92d65..4e39e4ab1 100644 --- a/command/push.go +++ b/command/push.go @@ -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. diff --git a/command/push_test.go b/command/push_test.go index 0cbe4cf23..e15402246 100644 --- a/command/push_test.go +++ b/command/push_test.go @@ -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) }