Skip to content

Commit c485479

Browse files
authored
second part of Issue 253 (#183)
* removed vendor from load device in project script * fixed unnecessary absolute file paths of issue 253/2
1 parent 071a784 commit c485479

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

internal/utils/utils.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,15 @@ func ConvertFilename(outPath, file, relativePathAdd string) (string, error) {
7979
log.Errorf("file or directory not found: %v", file)
8080
}
8181

82-
// Check if the file is absolute again after the conversion
83-
// This is needed because the file might be a relative path to the toolchain folder
84-
if !filepath.IsAbs(file) {
85-
var err error
86-
origfilename := file
87-
file, err = filepath.Rel(outPath, file)
88-
if err != nil {
89-
log.Errorf("path error found: %v", file)
90-
return origfilename, errors.New("path error")
91-
}
92-
file = filepath.ToSlash(file)
93-
file = "./" + file
82+
var err error
83+
origfilename := file
84+
file, err = filepath.Rel(outPath, file)
85+
if err != nil {
86+
log.Errorf("path error found: %v", file)
87+
return origfilename, nil
9488
}
89+
file = filepath.ToSlash(file)
90+
file = "./" + file
9591

9692
return file, nil
9793
}

0 commit comments

Comments
 (0)