Skip to content
This repository was archived by the owner on Jun 7, 2024. It is now read-only.

Commit 76cbafa

Browse files
committed
[get] fix OutOfRangeErr
1 parent f84d9d1 commit 76cbafa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fgit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,16 @@ func downloadFile(url, fpath string) {
249249
}
250250

251251
startDown:
252-
if strings.HasPrefix(url, "https://github.com") {
253-
query := strings.Replace(url, "https://github.com", "", -1)
252+
if strings.HasPrefix(url, "https://github.com/") {
253+
query := strings.Replace(url, "https://github.com/", "", -1)
254254
querySplit := strings.Split(query, "/")
255255
if len(querySplit) > 3 {
256256
// Source -> fastgitorg/fgit-go/blob/master/fgit.go
257257
// Target -> fastgitorg/fgit-go/master/fgit.go
258-
if querySplit[3] == "blob" {
258+
if querySplit[2] == "blob" {
259259
url = "https://raw.fastgit.org/"
260260
for _i, _s := range querySplit {
261-
if _i != 3 {
261+
if _i != 2 {
262262
// not /blob/
263263
if _i == len(querySplit)-1 {
264264
url += _s

0 commit comments

Comments
 (0)