gh: allow running in WSL

In WSL, we do not have `/usr/bin/winpty`. Let's verify that it is
available before using it, falling back to the `winpty`-less invocation.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2021-04-15 10:45:26 +02:00
parent 86beb5a328
commit 4cfaa7f6ae
2 changed files with 2 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ source=("$_realname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
"gh")
sha256sums=('5bdbc589a6d5cca241b2dc467d846a8f23c465d78efd898271f18b636608d6e6'
'4377ead0f9db015c0f290a8b86fbb630939a668622dd69ec882626aa8615e662'
'205b991248cd57c594f3be2cc1af9ea4a1a34c6008a16fac55ff8c49a4d664f8')
'9ee5f2b44b7e9aa751508f02c1020e341e0212a9aa146b7428eb5ffea310be27')
prepare() {
cd "cli-$pkgver"
patch -p1 -i ${srcdir}/0001-makefile-add-exe.patch

View File

@@ -2,7 +2,7 @@
GH_EXE="$( dirname ${BASH_SOURCE[0]} )/gh.exe"
if [ -t 0 -a -t 1 ]; then
if [ -t 0 -a -t 1 -a -x /usr/bin/winpty ]; then
/usr/bin/winpty $GH_EXE "$@"
else
exec $GH_EXE "$@"