Skip to content

Commit 2d6e0cb

Browse files
committed
add files from #559
1 parent 0ace355 commit 2d6e0cb

File tree

9 files changed

+5038
-4648
lines changed

9 files changed

+5038
-4648
lines changed

icon/icondarwin.go

+837-451
Large diffs are not rendered by default.

icon/iconlinux.go

+1,107-287
Large diffs are not rendered by default.

icon/iconwin.go

+3,071-3,895
Large diffs are not rendered by default.

icon/make_icon.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ IF NOT EXIST %GOPATH%\bin\2goarray.exe GOTO INSTALL
66
IF "%1"=="" GOTO NOICO
77
IF NOT EXIST %1 GOTO BADFILE
88
ECHO Creating iconwin.go
9-
ECHO //+build windows > iconwin.go
9+
ECHO // +build windows > iconwin.go
1010
ECHO. >> iconwin.go
1111
TYPE %1 | %GOPATH%\bin\2goarray Data icon >> iconwin.go
1212
GOTO DONE

icon/make_icon.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fi
2626

2727
OUTPUT=iconunix.go
2828
echo Generating $OUTPUT
29-
echo "//+build linux darwin" > $OUTPUT
29+
echo "// +build linux darwin" > $OUTPUT
3030
echo >> $OUTPUT
3131
cat "$1" | $GOPATH/bin/2goarray Data icon >> $OUTPUT
3232
if [ $? -ne 0 ]; then

seriallist.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func GetList(network bool) ([]OsSerialPort, error) {
5959
if reFilter.MatchString(element.Name) {
6060
newarrPorts = append(newarrPorts, element)
6161
} else {
62-
log.Debug("serial port did not match. port: %v\n", element)
62+
log.Debugf("serial port did not match. port: %v\n", element)
6363
}
6464

6565
}

tools/download_test.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package tools
22

33
import (
44
"fmt"
5-
"github.com/stretchr/testify/assert"
65
"io/ioutil"
76
"net/http"
87
"os"
98
"path"
109
"testing"
10+
11+
"github.com/stretchr/testify/assert"
1112
)
1213

1314
func Test_findBaseDir(t *testing.T) {
@@ -49,6 +50,12 @@ func TestTools_DownloadAndUnpackBehaviour(t *testing.T) {
4950
}
5051
expectedDirList := []string{"bin", "etc"}
5152

53+
tmpDir, err := ioutil.TempDir("", "download_test")
54+
if err != nil {
55+
t.Fatal(err)
56+
}
57+
defer os.RemoveAll(tmpDir)
58+
5259
for _, url := range urls {
5360
t.Log("Downloading tool from " + url)
5461
resp, err := http.Get(url)
@@ -63,7 +70,7 @@ func TestTools_DownloadAndUnpackBehaviour(t *testing.T) {
6370
t.Errorf("%v", err)
6471
}
6572

66-
location := path.Join("/tmp", dir(), "arduino", "avrdude", "6.3.0-arduino14")
73+
location := path.Join(tmpDir, "username", "arduino", "avrdude", "6.3.0-arduino14")
6774
os.MkdirAll(location, os.ModePerm)
6875
err = os.RemoveAll(location)
6976

@@ -97,7 +104,6 @@ func TestTools_DownloadAndUnpackBehaviour(t *testing.T) {
97104
}
98105

99106
assert.ElementsMatchf(t, dirList, expectedDirList, "error message %s", "formatted")
100-
101107
}
102108

103109
}

v2/pkgs/indexes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (c *Indexes) List(context.Context) ([]string, error) {
8484
for _, file := range files {
8585
// Select only files that begin with http
8686
decodedFileName, _ := b64.URLEncoding.DecodeString(file.Name())
87-
fileName:=string(decodedFileName)
87+
fileName := string(decodedFileName)
8888
if !strings.HasPrefix(fileName, "http") {
8989
continue
9090
}

v2/pkgs/tools_test.go

+10-8
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,23 @@ func strpoint(s string) *string {
144144

145145
func url() string {
146146
urls := map[string]string{
147-
"linuxamd64": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-x86_64-pc-linux-gnu.tar.bz2",
148-
"linux386": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-pc-linux-gnu.tar.bz2",
149-
"darwinamd64": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i386-apple-darwin11.tar.bz2",
150-
"windows386": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-mingw32.zip",
147+
"linuxamd64": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-x86_64-pc-linux-gnu.tar.bz2",
148+
"linux386": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-pc-linux-gnu.tar.bz2",
149+
"darwinamd64": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i386-apple-darwin11.tar.bz2",
150+
"windows386": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-mingw32.zip",
151+
"windowsamd64": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-mingw32.zip",
151152
}
152153

153154
return urls[runtime.GOOS+runtime.GOARCH]
154155
}
155156

156157
func checksum() string {
157158
checksums := map[string]string{
158-
"linuxamd64": "SHA-256:2489004d1d98177eaf69796760451f89224007c98b39ebb5577a9a34f51425f1",
159-
"linux386": "SHA-256:6f633dd6270ad0d9ef19507bcbf8697b414a15208e4c0f71deec25ef89cdef3f",
160-
"darwinamd64": "SHA-256:71117cce0096dad6c091e2c34eb0b9a3386d3aec7d863d2da733d9e5eac3a6b1",
161-
"windows386": "SHA-256:6c5483800ba753c80893607e30cade8ab77b182808fcc5ea15fa3019c63d76ae",
159+
"linuxamd64": "SHA-256:2489004d1d98177eaf69796760451f89224007c98b39ebb5577a9a34f51425f1",
160+
"linux386": "SHA-256:6f633dd6270ad0d9ef19507bcbf8697b414a15208e4c0f71deec25ef89cdef3f",
161+
"darwinamd64": "SHA-256:71117cce0096dad6c091e2c34eb0b9a3386d3aec7d863d2da733d9e5eac3a6b1",
162+
"windows386": "SHA-256:6c5483800ba753c80893607e30cade8ab77b182808fcc5ea15fa3019c63d76ae",
163+
"windowsamd64": "SHA-256:6c5483800ba753c80893607e30cade8ab77b182808fcc5ea15fa3019c63d76ae",
162164
}
163165
return checksums[runtime.GOOS+runtime.GOARCH]
164166

0 commit comments

Comments
 (0)