Commit 19fdc8aa authored by Cristian Maglie's avatar Cristian Maglie

Fixed regression upload with MKR1000 and other boards based on samd

parent 99a2de9b
...@@ -178,12 +178,6 @@ func run(command *cobra.Command, args []string) { ...@@ -178,12 +178,6 @@ func run(command *cobra.Command, args []string) {
// Make the filename without the FQBN configs part // Make the filename without the FQBN configs part
fqbn.Configs = properties.NewMap() fqbn.Configs = properties.NewMap()
fqbnSuffix := strings.Replace(fqbn.String(), ":", ".", -1) fqbnSuffix := strings.Replace(fqbn.String(), ":", ".", -1)
outputTmpFile, ok := uploadProperties.GetOk("recipe.output.tmp_file")
if !ok {
formatter.PrintErrorMessage("The platform does not define the required property 'recipe.output.tmp_file'.")
os.Exit(commands.ErrGeneric)
}
ext := filepath.Ext(outputTmpFile)
var importPath *paths.Path var importPath *paths.Path
var importFile string var importFile string
...@@ -193,10 +187,18 @@ func run(command *cobra.Command, args []string) { ...@@ -193,10 +187,18 @@ func run(command *cobra.Command, args []string) {
} else { } else {
importPath = paths.New(flags.importFile).Parent() importPath = paths.New(flags.importFile).Parent()
importFile = paths.New(flags.importFile).Base() importFile = paths.New(flags.importFile).Base()
}
outputTmpFile, ok := uploadProperties.GetOk("recipe.output.tmp_file")
outputTmpFile = uploadProperties.ExpandPropsInString(outputTmpFile)
if !ok {
formatter.PrintErrorMessage("The platform does not define the required property 'recipe.output.tmp_file'.")
os.Exit(commands.ErrGeneric)
}
ext := filepath.Ext(outputTmpFile)
if strings.HasSuffix(importFile, ext) { if strings.HasSuffix(importFile, ext) {
importFile = importFile[:len(importFile)-len(ext)] importFile = importFile[:len(importFile)-len(ext)]
} }
}
uploadProperties.SetPath("build.path", importPath) uploadProperties.SetPath("build.path", importPath)
uploadProperties.Set("build.project_name", importFile) uploadProperties.Set("build.project_name", importFile)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment