Skip to content

Commit

Permalink
Fix bug (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcauberer committed Nov 8, 2021
1 parent 9882479 commit fc3ba21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pass/generate/gen_copy_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ func GenerateCopyVolumes(project *model.CGProject, selected *model.SelectedTempl
// Change volume paths in composition to the new ones
for serviceIndex, service := range project.Composition.Services {
for volumeIndex, volume := range service.Volumes {
if strings.Contains(volume.Source, getPredefinedServicesPath()) {
dstPath := volume.Source[len(getPredefinedServicesPath()):]
srcPath := filepath.ToSlash(volume.Source)
if strings.Contains(srcPath, getPredefinedServicesPath()) {
dstPath := srcPath[len(getPredefinedServicesPath()):]
dstPath = project.Composition.WorkingDir + strings.Join(strings.Split(dstPath, "/")[3:], "/")
project.Composition.Services[serviceIndex].Volumes[volumeIndex].Source = dstPath
}
Expand Down

0 comments on commit fc3ba21

Please sign in to comment.