Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteeba2ce

Browse files
authored
Merge pull request#270 from arduino/path_bugfix_win
[WE-168] Path bugfix win
2 parents345f955 +393c743 commiteeba2ce

File tree

367 files changed

+52354
-44880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+52354
-44880
lines changed

‎Gopkg.lock

Lines changed: 104 additions & 125 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎Gopkg.toml

Lines changed: 6 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -27,76 +27,28 @@
2727

2828
[[constraint]]
2929
name ="github.com/Sirupsen/logrus"
30-
version ="1.0.6"
30+
version ="1.2.0"
3131

3232
[[constraint]]
3333
name ="github.com/blang/semver"
3434
version ="3.5.1"
3535

3636
[[constraint]]
37-
branch ="master"
38-
name ="github.com/creack/goselect"
39-
40-
[[constraint]]
41-
branch ="master"
42-
name ="github.com/getlantern/context"
43-
44-
[[constraint]]
45-
branch ="master"
46-
name ="github.com/getlantern/errors"
47-
48-
[[constraint]]
49-
branch ="master"
50-
name ="github.com/getlantern/filepersist"
51-
52-
[[constraint]]
53-
branch ="master"
54-
name ="github.com/getlantern/golog"
55-
56-
[[constraint]]
57-
branch ="master"
58-
name ="github.com/getlantern/hex"
59-
60-
[[constraint]]
61-
branch ="master"
62-
name ="github.com/getlantern/hidden"
63-
64-
[[constraint]]
65-
branch ="master"
66-
name ="github.com/getlantern/ops"
67-
68-
[[constraint]]
69-
name ="github.com/getlantern/stack"
70-
version ="1.5.1"
71-
72-
[[constraint]]
73-
branch ="master"
37+
revision ="89b3d9c45cc69f861868cc7f3159eba2b4cdfb22"
7438
name ="github.com/getlantern/systray"
7539

7640
[[constraint]]
7741
name ="github.com/gin-gonic/gin"
78-
version ="1.2.0"
42+
version ="1.3.0"
7943

8044
[[constraint]]
8145
name ="github.com/go-ini/ini"
82-
version ="1.38.1"
83-
84-
[[constraint]]
85-
branch ="master"
86-
name ="github.com/googollee/go-engine.io"
46+
version ="1.39.0"
8747

8848
[[constraint]]
8949
branch ="master"
9050
name ="github.com/googollee/go-socket.io"
9151

92-
[[constraint]]
93-
name ="github.com/gorilla/websocket"
94-
version ="1.2.0"
95-
96-
[[constraint]]
97-
branch ="filemode"
98-
name ="github.com/inconshreveable/go-update"
99-
10052
[[constraint]]
10153
name ="github.com/itsjamie/gin-cors"
10254
version ="1.0.0"
@@ -109,37 +61,13 @@
10961
name ="github.com/kr/binarydist"
11062
version ="0.1.0"
11163

112-
[[constraint]]
113-
name ="github.com/kr/fs"
114-
version ="0.1.0"
115-
116-
[[constraint]]
117-
branch ="master"
118-
name ="github.com/manucorporat/sse"
119-
120-
[[constraint]]
121-
name ="github.com/mattn/go-colorable"
122-
version ="0.0.9"
123-
124-
[[constraint]]
125-
name ="github.com/mattn/go-isatty"
126-
version ="0.0.3"
127-
128-
[[constraint]]
129-
name ="github.com/mattn/go-ole"
130-
version ="1.2.1"
131-
13264
[[constraint]]
13365
name ="github.com/mattn/go-shellwords"
13466
version ="1.0.3"
13567

13668
[[constraint]]
137-
name ="github.com/miekg/dns"
138-
version ="1.0.8"
139-
140-
[[constraint]]
141-
branch ="master"
14269
name ="github.com/mitchellh/go-homedir"
70+
version ="1.0.0"
14371

14472
[[constraint]]
14573
branch ="master"
@@ -149,10 +77,6 @@
14977
name ="github.com/pkg/errors"
15078
version ="0.8.0"
15179

152-
[[constraint]]
153-
name ="github.com/pkg/sftp"
154-
version ="1.8.0"
155-
15680
[[constraint]]
15781
branch ="master"
15882
name ="github.com/sfreiberg/simplessh"
@@ -161,18 +85,6 @@
16185
branch ="master"
16286
name ="github.com/skratchdot/open-golang"
16387

164-
[[constraint]]
165-
name ="github.com/smartystreets/goconvey"
166-
version ="1.6.3"
167-
168-
[[constraint]]
169-
name ="github.com/stretchr/testify"
170-
version ="1.2.2"
171-
172-
[[constraint]]
173-
branch ="master"
174-
name ="github.com/vharitonsky/iniflags"
175-
17688
[[constraint]]
17789
branch ="master"
17890
name ="github.com/xrash/smetrics"
@@ -185,27 +97,10 @@
18597
branch ="master"
18698
name ="golang.org/x/crypto"
18799

188-
[[constraint]]
189-
branch ="master"
190-
name ="golang.org/x/net"
191-
192-
[[constraint]]
193-
branch ="master"
194-
name ="golang.org/x/sys"
195-
196-
[[constraint]]
197-
name ="gopkg.in/bluesuncorp/validator.v5"
198-
version ="5.12.0"
199-
200100
[[constraint]]
201101
branch ="v0"
202102
name ="gopkg.in/inconshreveable/go-update.v0"
203103

204-
[[constraint]]
205-
name ="gopkg.in/ini.v1"
206-
version ="1.38.1"
207-
208104
[prune]
209-
non-go =true
210105
go-tests =true
211-
unused-packages =true
106+
unused-packages =true

‎main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ var homeTemplate = template.Must(template.New("home").Parse(homeTemplateHtml))
335335
consthomeTemplateHtml=`<!DOCTYPE html>
336336
<html>
337337
<head>
338-
<title>Serial Port Example</title>
338+
<title>Arduino Create Agent Debug Console</title>
339339
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
340340
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js"></script>
341341
<script type="text/javascript">

‎tools/download.go

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"encoding/hex"
1111
"encoding/json"
1212
"errors"
13+
"fmt"
1314
"io"
1415
"io/ioutil"
1516
"net/http"
@@ -226,7 +227,7 @@ func (t *Tools) Download(pack, name, version, behaviour string) error {
226227
// Decompress
227228
t.Logger("Unpacking tool "+name)
228229

229-
location:=path.Join(dir(),pack,correctTool.Name,correctTool.Version)
230+
location:=path.Join(dir(),pack,correctTool.Name,correctTool.Version)
230231
err=os.RemoveAll(location)
231232

232233
iferr!=nil {
@@ -240,12 +241,12 @@ func (t *Tools) Download(pack, name, version, behaviour string) error {
240241

241242
switchsrcType {
242243
case"application/zip":
243-
location,err=extractZip(body,location)
244+
location,err=extractZip(t.Logger,body,location)
244245
case"application/x-bz2":
245246
case"application/octet-stream":
246-
location,err=extractBz2(body,location)
247+
location,err=extractBz2(t.Logger,body,location)
247248
case"application/x-gzip":
248-
location,err=extractTarGz(body,location)
249+
location,err=extractTarGz(t.Logger,body,location)
249250
default:
250251
returnerrors.New("Unknown extension for file "+correctSystem.URL)
251252
}
@@ -376,7 +377,7 @@ func removeStringFromSlice(s []string, r string) []string {
376377

377378
funcfindBaseDir(dirList []string)string {
378379
iflen(dirList)==1 {
379-
returnfilepath.Dir(dirList[0])+"/"
380+
returnpath.Dir(dirList[0])+"/"
380381
}
381382

382383
// https://github.com/backdrop-ops/contrib/issues/55#issuecomment-73814500
@@ -385,14 +386,14 @@ func findBaseDir(dirList []string) string {
385386
dirList=removeStringFromSlice(dirList,v)
386387
}
387388

388-
commonBaseDir:=commonPrefix(os.PathSeparator,dirList)
389+
commonBaseDir:=commonPrefix('/',dirList)
389390
ifcommonBaseDir!="" {
390391
commonBaseDir=commonBaseDir+"/"
391392
}
392393
returncommonBaseDir
393394
}
394395

395-
funcextractZip(body []byte,locationstring) (string,error) {
396+
funcextractZip(logfunc(msgstring) ,body []byte,locationstring) (string,error) {
396397
path,err:=utilities.SaveFileonTempDir("tooldownloaded.zip",bytes.NewReader(body))
397398
r,err:=zip.OpenReader(path)
398399
iferr!=nil {
@@ -406,9 +407,11 @@ func extractZip(body []byte, location string) (string, error) {
406407
}
407408

408409
basedir:=findBaseDir(dirList)
410+
log(fmt.Sprintf("selected baseDir %s from Zip Archive Content: %v",basedir,dirList))
409411

410412
for_,f:=ranger.File {
411413
fullname:=filepath.Join(location,strings.Replace(f.Name,basedir,"",-1))
414+
log(fmt.Sprintf("generated fullname %s removing %s from %s",fullname,basedir,f.Name))
412415
iff.FileInfo().IsDir() {
413416
os.MkdirAll(fullname,f.FileInfo().Mode().Perm())
414417
}else {
@@ -439,7 +442,7 @@ func extractZip(body []byte, location string) (string, error) {
439442
returnlocation,nil
440443
}
441444

442-
funcextractTarGz(body []byte,locationstring) (string,error) {
445+
funcextractTarGz(logfunc(msgstring),body []byte,locationstring) (string,error) {
443446
bodyCopy:=make([]byte,len(body))
444447
copy(bodyCopy,body)
445448
tarFile,_:=gzip.NewReader(bytes.NewReader(body))
@@ -456,6 +459,7 @@ func extractTarGz(body []byte, location string) (string, error) {
456459
}
457460

458461
basedir:=findBaseDir(dirList)
462+
log(fmt.Sprintf("selected baseDir %s from TarGz Archive Content: %v",basedir,dirList))
459463

460464
tarFile,_=gzip.NewReader(bytes.NewReader(bodyCopy))
461465
tarReader=tar.NewReader(tarFile)
@@ -502,36 +506,8 @@ func extractTarGz(body []byte, location string) (string, error) {
502506
returnlocation,nil
503507
}
504508

505-
func (t*Tools)installDrivers(locationstring)error {
506-
OK_PRESSED:=6
507-
extension:=".bat"
508-
preamble:=""
509-
ifruntime.GOOS!="windows" {
510-
extension=".sh"
511-
// add ./ to force locality
512-
preamble="./"
513-
}
514-
if_,err:=os.Stat(filepath.Join(location,"post_install"+extension));err==nil {
515-
t.Logger("Installing drivers")
516-
ok:=MessageBox("Installing drivers","We are about to install some drivers needed to use Arduino/Genuino boards\nDo you want to continue?")
517-
ifok==OK_PRESSED {
518-
os.Chdir(location)
519-
t.Logger(preamble+"post_install"+extension)
520-
oscmd:=exec.Command(preamble+"post_install"+extension)
521-
ifruntime.GOOS!="linux" {
522-
// spawning a shell could be the only way to let the user type his password
523-
TellCommandNotToSpawnShell(oscmd)
524-
}
525-
err=oscmd.Run()
526-
returnerr
527-
}else {
528-
returnerrors.New("Could not install drivers")
529-
}
530-
}
531-
returnnil
532-
}
533509

534-
funcextractBz2(body []byte,locationstring) (string,error) {
510+
funcextractBz2(logfunc(msgstring),body []byte,locationstring) (string,error) {
535511
bodyCopy:=make([]byte,len(body))
536512
copy(bodyCopy,body)
537513
tarFile:=bzip2.NewReader(bytes.NewReader(body))
@@ -548,6 +524,7 @@ func extractBz2(body []byte, location string) (string, error) {
548524
}
549525

550526
basedir:=findBaseDir(dirList)
527+
log(fmt.Sprintf("selected baseDir %s from Bz2 Archive Content: %v",basedir,dirList))
551528

552529
tarFile=bzip2.NewReader(bytes.NewReader(bodyCopy))
553530
tarReader=tar.NewReader(tarFile)
@@ -596,6 +573,36 @@ func extractBz2(body []byte, location string) (string, error) {
596573
returnlocation,nil
597574
}
598575

576+
577+
func (t*Tools)installDrivers(locationstring)error {
578+
OK_PRESSED:=6
579+
extension:=".bat"
580+
preamble:=""
581+
ifruntime.GOOS!="windows" {
582+
extension=".sh"
583+
// add ./ to force locality
584+
preamble="./"
585+
}
586+
if_,err:=os.Stat(filepath.Join(location,"post_install"+extension));err==nil {
587+
t.Logger("Installing drivers")
588+
ok:=MessageBox("Installing drivers","We are about to install some drivers needed to use Arduino/Genuino boards\nDo you want to continue?")
589+
ifok==OK_PRESSED {
590+
os.Chdir(location)
591+
t.Logger(preamble+"post_install"+extension)
592+
oscmd:=exec.Command(preamble+"post_install"+extension)
593+
ifruntime.GOOS!="linux" {
594+
// spawning a shell could be the only way to let the user type his password
595+
TellCommandNotToSpawnShell(oscmd)
596+
}
597+
err=oscmd.Run()
598+
returnerr
599+
}else {
600+
returnerrors.New("Could not install drivers")
601+
}
602+
}
603+
returnnil
604+
}
605+
599606
funcmakeExecutable(locationstring)error {
600607
location=path.Join(location,"bin")
601608
files,err:=ioutil.ReadDir(location)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp