Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
mhewedy committed May 3, 2020
1 parent 11994e4 commit 66d7b43
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
9 changes: 0 additions & 9 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ func ExecuteI(command string, args ...string) error {
return nil
}

// Run runs command and return nothing
func Run(command string, args ...string) error {
if runtime.GOOS == "windows" {
args = prepend(args, command)
command = "powershell"
}
return exec.Command(command, args...).Run()
}

func prepend(x []string, y string) []string {
x = append(x, "")
copy(x[1:], x)
Expand Down
3 changes: 2 additions & 1 deletion ip/cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
)

func doPing(ip string) error {
return cmd.Run("ping", "-c", "1", "-W", "0.1", ip)
_, err := cmd.Execute("ping", "-c", "1", "-W", "0.1", ip)
return err
}

func getArpTable() []addr {
Expand Down
3 changes: 2 additions & 1 deletion ip/cmds_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
)

func doPing(ip string) error {
return cmd.Run("ping", "-n", "1", "-w", "0.1", ip)
_, err := cmd.Execute("ping", "-n", "1", "-w", "0.1", ip)
return err
}

func getArpTable() []addr {
Expand Down

0 comments on commit 66d7b43

Please sign in to comment.