Skip to content

Commit

Permalink
remove pty to fix windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Dec 10, 2018
1 parent dee9a7b commit 15b137b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ module github.com/codeskyblue/fa

require (
github.com/cavaliercoder/grab v2.0.0+incompatible
github.com/kr/pty v1.1.1
github.com/manifoldco/promptui v0.3.2
github.com/mattn/go-runewidth v0.0.3 // indirect
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
github.com/pkg/errors v0.8.0
github.com/shogo82148/androidbinary v0.0.0-20180627093851-01c4bfa8b3b5
github.com/urfave/cli v1.20.0
gopkg.in/cheggaaa/pb.v1 v1.0.25
gopkg.in/urfave/cli.v1 v1.20.0
)
14 changes: 5 additions & 9 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import (
"time"

"github.com/cavaliercoder/grab"
"github.com/kr/pty"
"github.com/pkg/errors"
"github.com/shogo82148/androidbinary/apk"
"github.com/urfave/cli"
pb "gopkg.in/cheggaaa/pb.v1"
cli "gopkg.in/urfave/cli.v1"
)

func httpDownload(dst string, url string) (resp *grab.Response, err error) {
Expand Down Expand Up @@ -92,13 +91,10 @@ func actInstall(ctx *cli.Context) error {
// install
outBuffer := bytes.NewBuffer(nil)
c := adbCommand(serial, "install", "-r", apkpath)
ttyf, err := pty.Start(c)
if err != nil {
return err
}
mwr := io.MultiWriter(os.Stdout, outBuffer)
io.Copy(mwr, ttyf)
if err := c.Wait(); err != nil {
c.Stdout = io.MultiWriter(os.Stdout, outBuffer)
c.Stderr = os.Stderr

if err := c.Run(); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"syscall"

"github.com/manifoldco/promptui"
"github.com/urfave/cli"
cli "gopkg.in/urfave/cli.v1"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion screenshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
"os"

"github.com/pkg/browser"
"github.com/urfave/cli"
// "github.com/urfave/cli"
cli "gopkg.in/urfave/cli.v1"
)

func anyFuncs(funcs ...func() error) error {
Expand Down

0 comments on commit 15b137b

Please sign in to comment.