Skip to content

Commit

Permalink
Remove ppc from freebsd as it is not available in go1.18beta1. Check …
Browse files Browse the repository at this point in the history
…error in Getsize(). (#137)
  • Loading branch information
creack authored Jan 31, 2022
1 parent 7b57fd2 commit edfd13d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
26 changes: 13 additions & 13 deletions test_crosscompile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
# Does not actually test the logic, just the compilation so we make sure we don't break code depending on the lib.

echo2() {
echo $@ >&2
echo $@ >&2
}

trap end 0
end() {
[ "$?" = 0 ] && echo2 "Pass." || (echo2 "Fail."; exit 1)
[ "$?" = 0 ] && echo2 "Pass." || (echo2 "Fail."; exit 1)
}

cross() {
os=$1
shift
echo2 "Build for $os."
for arch in $@; do
echo2 " - $os/$arch"
GOOS=$os GOARCH=$arch go build
done
echo2
os=$1
shift
echo2 "Build for $os."
for arch in $@; do
echo2 " - $os/$arch"
GOOS=$os GOARCH=$arch go build
done
echo2
}

set -e

cross linux amd64 386 arm arm64 ppc64 ppc64le s390x mips mipsle mips64 mips64le
cross darwin amd64 arm64
cross freebsd amd64 386 arm arm64 ppc64
cross freebsd amd64 386 arm arm64
cross netbsd amd64 386 arm arm64
cross openbsd amd64 386 arm arm64
cross dragonfly amd64
Expand All @@ -41,8 +41,8 @@ cross windows amd64 386 arm

# Some os/arch require a different compiler. Run in docker.
if ! hash docker; then
# If docker is not present, stop here.
return
# If docker is not present, stop here.
return
fi

echo2 "Build for linux."
Expand Down
5 changes: 4 additions & 1 deletion winsize.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ func InheritSize(pty, tty *os.File) error {
// in each line) in terminal t.
func Getsize(t *os.File) (rows, cols int, err error) {
ws, err := GetsizeFull(t)
return int(ws.Rows), int(ws.Cols), err
if err != nil {
return 0, 0, err
}
return int(ws.Rows), int(ws.Cols), nil
}

0 comments on commit edfd13d

Please sign in to comment.