Skip to content

fix: Fix typo #562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions arduino/cores/packagemanager/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir
}

for _, file := range files {
architecure := file.Base()
if strings.HasPrefix(architecure, ".") || architecure == "tools" ||
architecure == "platform.txt" { // TODO: Check if this "platform.txt" condition should be here....
architecture := file.Base()
if strings.HasPrefix(architecture, ".") || architecture == "tools" ||
architecture == "platform.txt" { // TODO: Check if this "platform.txt" condition should be here....
continue
}
platformPath := packageDir.Join(architecure)
platformPath := packageDir.Join(architecture)
if !platformPath.IsDir() {
continue
}
Expand Down Expand Up @@ -197,16 +197,16 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir
index.MergeIntoPackages(tmp)
if tmpPackage := tmp.GetOrCreatePackage(targetPackage.Name); tmpPackage == nil {
pm.Log.Warnf("Can't determine bundle platform version for %s", targetPackage.Name)
} else if tmpPlatform := tmpPackage.GetOrCreatePlatform(architecure); tmpPlatform == nil {
pm.Log.Warnf("Can't determine bundle platform version for %s:%s", targetPackage.Name, architecure)
} else if tmpPlatform := tmpPackage.GetOrCreatePlatform(architecture); tmpPlatform == nil {
pm.Log.Warnf("Can't determine bundle platform version for %s:%s", targetPackage.Name, architecture)
} else if tmpPlatformRelease := tmpPlatform.GetLatestRelease(); tmpPlatformRelease == nil {
pm.Log.Warnf("Can't determine bundle platform version for %s:%s, no valid release found", targetPackage.Name, architecure)
pm.Log.Warnf("Can't determine bundle platform version for %s:%s, no valid release found", targetPackage.Name, architecture)
} else {
version = tmpPlatformRelease.Version
}
}

platform := targetPackage.GetOrCreatePlatform(architecure)
platform := targetPackage.GetOrCreatePlatform(architecture)
release, err := platform.GetOrCreateRelease(version)
if err != nil {
return fmt.Errorf("loading platform release: %s", err)
Expand All @@ -221,7 +221,7 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir
// case: ARCHITECTURE/VERSION/boards.txt
// let's dive into VERSION directories

platform := targetPackage.GetOrCreatePlatform(architecure)
platform := targetPackage.GetOrCreatePlatform(architecture)
versionDirs, err := platformPath.ReadDir()
if err != nil {
return fmt.Errorf("reading dir %s: %s", platformPath, err)
Expand Down
8 changes: 4 additions & 4 deletions arduino/cores/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ func (packages Packages) GetDepsOfPlatformRelease(release *PlatformRelease) ([]*

// GetOrCreatePlatform returns the Platform object with the specified architecture
// or creates a new one if not found
func (targetPackage *Package) GetOrCreatePlatform(architecure string) *Platform {
if platform, ok := targetPackage.Platforms[architecure]; ok {
func (targetPackage *Package) GetOrCreatePlatform(architecture string) *Platform {
if platform, ok := targetPackage.Platforms[architecture]; ok {
return platform
}
targetPlatform := &Platform{
Architecture: architecure,
Architecture: architecture,
Releases: map[string]*PlatformRelease{},
Package: targetPackage,
}
targetPackage.Platforms[architecure] = targetPlatform
targetPackage.Platforms[architecture] = targetPlatform
return targetPlatform
}

Expand Down
2 changes: 1 addition & 1 deletion cli/lib/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
func initSearchCommand() *cobra.Command {
searchCommand := &cobra.Command{
Use: "search [LIBRARY_NAME]",
Short: "Searchs for one or more libraries data.",
Short: "Searches for one or more libraries data.",
Long: "Search for one or more libraries data (case insensitive search).",
Example: " " + os.Args[0] + " lib search audio",
Args: cobra.ArbitraryArgs,
Expand Down