Skip to content

Commit bc86692

Browse files
rsoracmaglie
rsora
authored andcommitted
Use TrimSuffix instead of replace
1 parent 1fb9ccc commit bc86692

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: commands/upload/upload.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ func runProgramAction(pm *packagemanager.PackageManager,
249249
}
250250
importPath = importFilePath.Parent()
251251
// In general, the binary file extension (like .bin or .hex or even .zip) are already written explicitly in
252-
// the core recipes. This why the CLI removes it before setting the build.project_name property.
253-
importFileName := strings.ReplaceAll(importFilePath.Base(), importFilePath.Ext(), "")
252+
// the core recipes inside platform.txt. This why the CLI removes it before setting the build.project_name
253+
// property.
254+
importFileName := strings.TrimSuffix(importFilePath.Base(), importFilePath.Ext())
254255
uploadProperties.SetPath("build.path", importPath)
255256
uploadProperties.Set("build.project_name", importFileName)
256257
} else {

0 commit comments

Comments
 (0)