Skip to content

Commit

Permalink
Keep resource mapping file and skipped resource file in hcl only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
magodo committed Mar 1, 2023
1 parent b6afcc5 commit 73750db
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/meta/base_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,21 @@ func (meta baseMeta) CleanUpWorkspace(_ context.Context) error {

tmpMainCfg := filepath.Join(tmpDir, meta.outputFileNames.MainFileName)
tmpProviderCfg := filepath.Join(tmpDir, meta.outputFileNames.ProviderFileName)
tmpResourceMappingFileName := filepath.Join(tmpDir, ResourceMappingFileName)
tmpSkippedResourcesFileName := filepath.Join(tmpDir, SkippedResourcesFileName)

if err := utils.CopyFile(filepath.Join(meta.outdir, meta.outputFileNames.MainFileName), tmpMainCfg); err != nil {
return err
}
if err := utils.CopyFile(filepath.Join(meta.outdir, meta.outputFileNames.ProviderFileName), tmpProviderCfg); err != nil {
return err
}
if err := utils.CopyFile(filepath.Join(meta.outdir, ResourceMappingFileName), tmpResourceMappingFileName); err != nil {
return err
}
if err := utils.CopyFile(filepath.Join(meta.outdir, SkippedResourcesFileName), tmpSkippedResourcesFileName); err != nil {
return err
}

if err := utils.RemoveEverythingUnder(meta.outdir); err != nil {
return err
Expand All @@ -515,6 +523,12 @@ func (meta baseMeta) CleanUpWorkspace(_ context.Context) error {
if err := utils.CopyFile(tmpProviderCfg, filepath.Join(meta.outdir, meta.outputFileNames.ProviderFileName)); err != nil {
return err
}
if err := utils.CopyFile(tmpResourceMappingFileName, filepath.Join(meta.outdir, ResourceMappingFileName)); err != nil {
return err
}
if err := utils.CopyFile(tmpSkippedResourcesFileName, filepath.Join(meta.outdir, SkippedResourcesFileName)); err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit 73750db

Please sign in to comment.