Skip to content

Rewrite of download #79

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

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix stupid typo again
  • Loading branch information
matteosuppo committed May 4, 2016
commit 7ac5aa0652de9b628da7a58e403896984df8b2b4
6 changes: 4 additions & 2 deletions seriallist_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package main
import (
"os/exec"
"strings"

"github.com/arduino/arduino-create-agent/utilities"
)

// execute system_profiler SPUSBDataType | grep "Vendor ID: 0x2341" -A5 -B2
Expand All @@ -28,12 +30,12 @@ func associateVidPidWithPort(ports []OsSerialPort) []OsSerialPort {

usbcmd := exec.Command("system_profiler", "SPUSBDataType")
grepcmd := exec.Command("grep", "Location ID: 0x"+port_hash[:len(port_hash)-1], "-B6")
cmdOutput, _ := utillities.PipeCommands(usbcmd, grepcmd)
cmdOutput, _ := utilities.PipeCommands(usbcmd, grepcmd)

if len(cmdOutput) == 0 {
usbcmd = exec.Command("system_profiler", "SPUSBDataType")
grepcmd = exec.Command("grep" /*"Serial Number: "+*/, strings.Trim(port_hash, "0"), "-B3", "-A3")
cmdOutput, _ = utillities.PipeCommands(usbcmd, grepcmd)
cmdOutput, _ = utilities.PipeCommands(usbcmd, grepcmd)
}

if len(cmdOutput) == 0 {
Expand Down