mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
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
|
// Build the archiving options, which includes everything it can
|
||||||
// by default according to VCS rules but forcing the data directory.
|
// by default according to VCS rules but forcing the data directory.
|
||||||
archiveOpts := &archive.ArchiveOpts{
|
archiveOpts := &archive.ArchiveOpts{
|
||||||
Include: []string{filepath.Join(c.DataDir())},
|
VCS: true,
|
||||||
VCS: true,
|
Extra: map[string]string{
|
||||||
|
DefaultDataDir: c.DataDir(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
if !moduleLock {
|
if !moduleLock {
|
||||||
// If we're not locking modules, then exclude the modules dir.
|
// 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)
|
actual := testArchiveStr(t, archivePath)
|
||||||
expected := []string{}
|
expected := []string{
|
||||||
|
".terraform/",
|
||||||
|
".terraform/terraform.tfstate",
|
||||||
|
"main.tf",
|
||||||
|
}
|
||||||
if !reflect.DeepEqual(actual, expected) {
|
if !reflect.DeepEqual(actual, expected) {
|
||||||
t.Fatalf("bad: %#v", actual)
|
t.Fatalf("bad: %#v", actual)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user