Commit ff0471c4
ff0471c45660Merged
Dmitriy Zhilyaev <[email protected]> ยท 2 years ago ยท 3 files ยท ~3 modified
Description
fix: test remote-source
Signed-off-by: Dmitriy Zhilyaev [email protected]
Details
- Commit
- ff0471c45660
- Parent
- c387f8ec2a5f
pkg/action/build.gomodifiedView file
@@ -34,16 +34,18 @@
3434
3535
// Run is the main function for 'build' CLI command.3636
func (i *Build) Run(ctx context.Context) (err error) {37+
3738
// Download Remote source3839
if i.remoteSource != "" {39-
downloadPath, err := i.downloadRemoteSrc(ctx)40+
wd, err := os.Getwd()4041
if err != nil {41-
return err42+
return fmt.Errorf("failed to get current directory: %w", err)4243
}44+
log.Tracef("Work dir: %s", wd)4345
44-
wd, err := os.Getwd()46+
downloadPath, err := i.downloadRemoteSrc(ctx)4547
if err != nil {46-
return fmt.Errorf("failed to get current directory: %w", err)48+
return err4749
}4850
4951
defer i.cleanRemoteSrc(downloadPath, wd)@@ -167,16 +169,11 @@
167169
return m168170
}169171
170-
func (i *Build) cleanRemoteSrc(src, dest string) {171-
srcPlandir := filepath.Join(src, i.plandir)172-
destPlandir := filepath.Join(dest, i.plandir)173-
174-
err := os.RemoveAll(destPlandir)175-
if err != nil {176-
log.WithError(err).Error("failed to clean plandir")177-
}172+
func (i *Build) cleanRemoteSrc(downloadPath, wd string) {173+
srcPlandir := filepath.Join(downloadPath, i.plandir)174+
destPlandir := filepath.Join(wd, i.plandir)178175
179-
err = helper.MoveFile(srcPlandir, destPlandir)176+
err := helper.MoveFile(srcPlandir, destPlandir)180177
if err != nil {181178
log.WithError(err).Error("failed to move plandir")182179
}pkg/action/build_internal_test.gomodifiedView file
Loading diffโฆ
pkg/plan/export.gomodifiedView file
Loading diffโฆ