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

Commit 40b5709

Browse files
committed
feat: add end point
1 parent f75b2c4 commit 40b5709

File tree

5 files changed

+33
-9
lines changed

5 files changed

+33
-9
lines changed

build.bat

+9-7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ set timestamp=%date% %time%
1414
echo Version: %version%
1515
echo Build Time: %timestamp%
1616

17+
cd src
18+
1719
echo -^> Removing old files
1820
del /s /Q release > nul
1921

@@ -22,34 +24,34 @@ set GOARCH=amd64
2224

2325
set GOOS=windows
2426
echo --^> Compiling Windows
25-
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-windows-amd64.exe .\src
27+
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-windows-amd64.exe .\
2628
set GOOS=darwin
2729
echo --^> Compiling Darwin
28-
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-darwin-amd64 .\src
30+
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-darwin-amd64 .\
2931
set GOOS=linux
3032
echo --^> Compiling Linux
31-
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-linux-amd64 .\src
33+
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-linux-amd64 .\
3234

3335
set GOARCH=386
3436
echo -^> Compiling 386
3537
set GOOS=windows
3638
echo --^> Compiling Windows
37-
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-windows-386.exe .\src
39+
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-windows-386.exe .\
3840
set GOOS=linux
3941
echo --^> Compiling Linux
40-
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-linux-386 .\src
42+
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-linux-386 .\
4143

4244

4345
set GOARCH=arm
4446
echo -^> Compiling ARM
4547
set GOOS=linux
4648
echo --^> Compiling Linux
47-
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-linux-arm .\src
49+
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-linux-arm .\
4850

4951
set GOARCH=arm64
5052
echo -^> Compiling ARM64
5153
set GOOS=linux
5254
echo --^> Compiling Linux
53-
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-linux-arm64 .\src
55+
go build -ldflags="-s -w -X main.version=%version% -X 'main.timestamp=%timestamp%'" -o release\fgit-linux-arm64 .\
5456

5557
pause

src/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ func main() {
3838
case "get", "dl", "download":
3939
runByArgs(&oper.GetFunc{})
4040

41+
case "ep", "endpoint", "target":
42+
runByArgs(&oper.EndPointFunc{})
43+
4144
case "conv", "convert":
4245
runByArgs(&oper.ConvFunc{})
4346

src/oper/endpoint.go

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package oper
2+
3+
import (
4+
"fgit-go/shared"
5+
"fmt"
6+
"os"
7+
)
8+
9+
type EndPointFunc struct {
10+
}
11+
12+
func (c *EndPointFunc) Run(args []string) {
13+
fmt.Println(
14+
"FastGit EndPoint Command Line Tool\n" +
15+
"==================================")
16+
fmt.Printf("https://github.com -> %s\n", shared.GitMirror)
17+
fmt.Printf("https://raw.githubusercontent.com -> %s\n", shared.RawMirror)
18+
fmt.Printf("GitHub Download -> %s\n", shared.DownloadMirror)
19+
os.Exit(0)
20+
}

src/shared/const.go

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const (
1111
" fgit debug [URL<string>] [--help|-h]\n" +
1212
" fgit get [URL<string>] [Path<string>] [--help|-h]\n" +
1313
" fgit conv [Target<string>] [--help|-h]\n" +
14-
" fgit jsdget [URL<string>] [Path<string>]\n" +
1514
" If you want to known more about extra-syntax, try to use --help"
1615
GetHelpMsg = "FastGit Get Command Line Tool\n" +
1716
"=============================\n" +

version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8-alpha-1
1+
0.8-alpha-2

0 commit comments

Comments
 (0)