File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,12 +205,19 @@ Examples:
205205 // For directories, preserve the structure
206206 relPath , err := filepath .Rel (pair .Source , sourceFile )
207207 if err != nil {
208- // If we can't get relative path, use just the filename
209- destPath = filepath . Join ( pair .Destination , filepath . Base ( sourceFile ))
208+ // If we can't get relative path, use just the destination directory
209+ destPath = pair .Destination
210210 } else {
211- destPath = filepath .Join (pair .Destination , relPath )
211+ // Destination should be directory only (excluding the filename)
212+ // The FilePath field in manifest will have the filename
213+ destPath = filepath .Join (pair .Destination , filepath .Dir (relPath ))
214+ // Ensure it ends with / for directory paths
215+ if destPath != "" && ! strings .HasSuffix (destPath , "/" ) {
216+ destPath += "/"
217+ }
212218 }
213219 } else {
220+ // For single files, destination is the directory
214221 destPath = pair .Destination
215222 }
216223
You can’t perform that action at this time.
0 commit comments