command/push: "Extra" value must be absolute

This commit is contained in:
Mitchell Hashimoto 2016-08-23 22:58:58 -07:00
parent f0de3c3e91
commit 3aecc52bf3
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 10 additions and 1 deletions

View File

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