Skip to content

Commit e5b51eb

Browse files
committed
Compatibility with gh 2.0.0
1 parent 4934181 commit e5b51eb

File tree

5 files changed

+70
-9
lines changed

5 files changed

+70
-9
lines changed

README

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# gh repo-explore
2+
3+
A [gh](https://github.com/cli/cli) extension for interactively exploring a repo without cloning the entire repo.
4+
5+
## installation
6+
7+
```sh
8+
gh extension install samcoe/gh-repo-explore
9+
```
10+
11+
## usage
12+
13+
```sh
14+
# explore a repo
15+
gh repo-explore samcoe/gh-repo-explore
16+
17+
# explore specific branch of a repo
18+
gh repo-explore samcoe/gh-repo-explore --branch trunk
19+
```
20+
21+
Supports `--hostname` flag to explore repos on hosts other than `github.com`.

gh-repo-explore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
set -e
3+
4+
extensionPath="$(dirname "$0")"
5+
arch="$(uname -m)"
6+
7+
if uname -a | grep Msys > /dev/null; then
8+
if [ $arch = "x86_64" ]; then
9+
exec "${extensionPath}/dist/gh-repo-explore_windows_amd64/gh-repo-explore" "$@"
10+
elif [ $arch = "i686" ]; then
11+
exec "${extensionPath}/dist/gh-repo-explore_windows_386/gh-repo-explore" "$@"
12+
elif [ $arch = "i386" ]; then
13+
exec "${extensionPath}/dist/gh-repo-explore_windows_386/gh-repo-explore" "$@"
14+
fi
15+
elif uname -a | grep Darwin > /dev/null; then
16+
if [ $arch = "x86_64" ]; then
17+
exec "${extensionPath}/dist/gh-repo-explore_darwin_amd64/gh-repo-explore" "$@"
18+
fi
19+
elif uname -a | grep Linux > /dev/null; then
20+
if [ $arch = "x86_64" ]; then
21+
exec "${extensionPath}/dist/gh-repo-explore_linux_amd64/gh-repo-explore" "$@"
22+
elif [ $arch = "i686" ]; then
23+
exec "${extensionPath}/dist/gh-repo-explore_linux_386/gh-repo-explore" "$@"
24+
elif [ $arch = "i386" ]; then
25+
exec "${extensionPath}/dist/gh-repo-explore_linux_386/gh-repo-explore" "$@"
26+
fi
27+
fi
28+
29+
if [ "$(which go)" = "" ]; then
30+
echo "go must be installed to use this gh extension on this platform"
31+
exit 1
32+
fi
33+
34+
exe="cmd.out"
35+
36+
cd "${extensionPath}" > /dev/null
37+
go build -o "${exe}"
38+
cd - > /dev/null
39+
40+
exec "${extensionPath}/${exe}" "$@"

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/samcoe/gh-repo-explore
33
go 1.16
44

55
require (
6-
github.com/alecthomas/chroma v0.9.1
7-
github.com/gdamore/tcell/v2 v2.3.3
8-
github.com/rivo/tview v0.0.0-20210601084449-25fe82727029
6+
github.com/alecthomas/chroma v0.9.2
7+
github.com/gdamore/tcell/v2 v2.4.0
8+
github.com/rivo/tview v0.0.0-20210624165335-29d673af0ce2
99
)

go.sum

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
22
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
3-
github.com/alecthomas/chroma v0.9.1 h1:cBmvQqRImzR5aWqdMxYZByND4S7BCS/g0svZb28h0Dc=
4-
github.com/alecthomas/chroma v0.9.1/go.mod h1:eMuEnpA18XbG/WhOWtCzJHS7WqEtDAI+HxdwoW0nVSk=
3+
github.com/alecthomas/chroma v0.9.2 h1:yU1sE2+TZbLIQPMk30SolL2Hn53SR/Pv750f7qZ/XMs=
4+
github.com/alecthomas/chroma v0.9.2/go.mod h1:eMuEnpA18XbG/WhOWtCzJHS7WqEtDAI+HxdwoW0nVSk=
55
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo=
66
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
77
github.com/alecthomas/kong v0.2.4/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE=
@@ -15,8 +15,9 @@ github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E
1515
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
1616
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
1717
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
18-
github.com/gdamore/tcell/v2 v2.3.3 h1:RKoI6OcqYrr/Do8yHZklecdGzDTJH9ACKdfECbRdw3M=
1918
github.com/gdamore/tcell/v2 v2.3.3/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
19+
github.com/gdamore/tcell/v2 v2.4.0 h1:W6dxJEmaxYvhICFoTY3WrLLEXsQ11SaFnKGVEXW57KM=
20+
github.com/gdamore/tcell/v2 v2.4.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU=
2021
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
2122
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
2223
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
@@ -28,8 +29,8 @@ github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRC
2829
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
2930
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
3031
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
31-
github.com/rivo/tview v0.0.0-20210601084449-25fe82727029 h1:6dS+di2EacbrIFK+h/NxaKZMiWvUDYKleaIWYuBVEMo=
32-
github.com/rivo/tview v0.0.0-20210601084449-25fe82727029/go.mod h1:IxQujbYMAh4trWr0Dwa8jfciForjVmxyHpskZX6aydQ=
32+
github.com/rivo/tview v0.0.0-20210624165335-29d673af0ce2 h1:I5N0WNMgPSq5NKUFspB4jMJ6n2P0ipz5FlOlB4BXviQ=
33+
github.com/rivo/tview v0.0.0-20210624165335-29d673af0ce2/go.mod h1:IxQujbYMAh4trWr0Dwa8jfciForjVmxyHpskZX6aydQ=
3334
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
3435
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
3536
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=

0 commit comments

Comments
 (0)