Skip to content

Commit

Permalink
Read a dir from TerraformCLI
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Aug 5, 2020
1 parent b42f947 commit e10eb28
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tfmigrate/state_migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
type StateMigrator struct {
// tf is an instance of TerraformCLI.
tf tfexec.TerraformCLI
// dir is a work directory where terraform command is executed.
dir string
// actions is a list of state migration operations.
actions []StateAction
}
Expand All @@ -33,7 +31,6 @@ func NewStateMigrator(dir string, actions []StateAction, o *MigratorOption) *Sta

return &StateMigrator{
tf: tf,
dir: dir,
actions: actions,
}
}
Expand Down Expand Up @@ -63,7 +60,7 @@ func (m *StateMigrator) plan(ctx context.Context) (*tfexec.State, error) {
}

// create local backend override file.
overrideFilePath := filepath.Join(m.dir, "_tfmigrate_override.tf")
overrideFilePath := filepath.Join(tf.Dir(), "_tfmigrate_override.tf")
overrideContents := `
terraform {
backend "local" {
Expand Down

0 comments on commit e10eb28

Please sign in to comment.