Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
saniales committed Jun 20, 2017
1 parent 63276ad commit 35b8a6d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
31 changes: 30 additions & 1 deletion libraries/download.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
/*
* This file is part of arduino-cli.
*
* arduino-cli is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* As a special exception, you may use this file as part of a free software
* library without restriction. Specifically, if other files instantiate
* templates or use macros or inline functions from this file, or you compile
* this file and link it with other files to produce an executable, this
* file does not by itself cause the resulting executable to be covered by
* the GNU General Public License. This exception does not however
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
* Copyright 2017 BCMI LABS SA (http://www.arduino.cc/)
*/

package libraries

import (
Expand Down Expand Up @@ -33,7 +62,7 @@ func downloadLatest(library *Library) ([]byte, error) {
return common.DownloadPackage(library.Latest.URL)
}

//DownloadLibrariesFile downloads the lib file from arduino repository.
// DownloadLibrariesFile downloads the lib file from arduino repository.
func DownloadLibrariesFile() error {
libFile, err := IndexPath()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion libraries/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (indexLib *IndexRelease) ExtractRelease() *Release {
}

// ExtractLibrary create a new Library with the information contained
// in this index element
// in this index element.
func (indexLib *IndexRelease) ExtractLibrary() *Library {
release := indexLib.ExtractRelease()
return &Library{
Expand Down
4 changes: 2 additions & 2 deletions libraries/install_uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import (
"github.com/bcmi-labs/arduino-cli/common"
)

var install func(*zip.Reader, string) error = common.Unzip
var install = common.Unzip

// Uninstall a library means remove its directory.
var Uninstall func(libraryFolder string) error = os.RemoveAll
var Uninstall = os.RemoveAll

// DownloadAndInstall downloads a library and installs it to its specified location.
func DownloadAndInstall(library *Library) error {
Expand Down

0 comments on commit 35b8a6d

Please sign in to comment.