From 3aecc52bf36c5f12dd5312c21f5739aee7efa0b3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 23 Aug 2016 22:58:58 -0700 Subject: [PATCH] command/push: "Extra" value must be absolute --- command/push.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/command/push.go b/command/push.go index 981b8c6d7..37dbf5a69 100644 --- a/command/push.go +++ b/command/push.go @@ -191,12 +191,21 @@ func (c *PushCommand) Run(args []string) int { return 1 } + // Get the absolute path for our data directory, since the Extra field + // value below needs to be absolute. + dataDirAbs, err := filepath.Abs(c.DataDir()) + if err != nil { + c.Ui.Error(fmt.Sprintf( + "Error while expanding the data directory %q: %s", c.DataDir(), err)) + return 1 + } + // Build the archiving options, which includes everything it can // by default according to VCS rules but forcing the data directory. archiveOpts := &archive.ArchiveOpts{ VCS: archiveVCS, Extra: map[string]string{ - DefaultDataDir: c.DataDir(), + DefaultDataDir: dataDirAbs, }, } if !moduleUpload {