From 462e891a612129f1b12c8121f2e51bd9bac9bb8d Mon Sep 17 00:00:00 2001 From: Star <> Date: Wed, 26 Jun 2024 12:16:21 +0800 Subject: [PATCH] to apigo.cc --- README.md | 2 +- go.mod | 8 +++++--- main.go | 18 +++++++++--------- templates/_main.go | 2 +- templates/_main_test.go | 2 +- templates/_makePluginCode.go | 4 ++-- templates/_plugin.go | 2 +- templates/_plugin_test.go | 2 +- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 399e545..4b57bfe 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Install ```shell -go install apigo.cloud/git/apigo/ag@latest +go install apigo.cc/apigo/ag@latest ``` ## Usage diff --git a/go.mod b/go.mod index 1fb12fa..b9ba630 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,14 @@ -module apigo.cloud/git/apigo/ag +module apigo.cc/apigo/ag go 1.18 -require github.com/ssgo/u v1.7.5 +require ( + github.com/ssgo/httpclient v1.7.5 + github.com/ssgo/u v1.7.5 +) require ( github.com/ssgo/config v1.7.5 // indirect - github.com/ssgo/httpclient v1.7.5 // indirect github.com/ssgo/log v1.7.5 // indirect github.com/ssgo/standard v1.7.5 // indirect golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53 // indirect diff --git a/main.go b/main.go index 312d636..96dfa76 100644 --- a/main.go +++ b/main.go @@ -18,7 +18,7 @@ import ( "time" ) -var version = "v0.0.6" +var version = "v0.0.8" //go:embed templates/_makePluginCode.go var makePluginCodeTPL string @@ -215,11 +215,11 @@ func parseRepo(url string) (apiUrl, owner, repo string) { } else if strings.HasPrefix(url, "gitee.com/") { apiUrl = "https://gitee.com/api/v5/" name = url[10:] - } else if strings.HasPrefix(url, "apigo.cloud/git/") { - apiUrl = "https://apigo.cloud/git/api/v1/" + } else if strings.HasPrefix(url, "apigo.cc/") { + apiUrl = "https://apigo.cc/api/v1/" name = url[16:] } else { - apiUrl = "https://apigo.cloud/git/api/v1/" + apiUrl = "https://apigo.cc/api/v1/" if strings.ContainsRune(url, '/') { name = url } else { @@ -346,8 +346,8 @@ func initProject(args []string) { _ = runCommand("go", "mod", "init", name) _ = runCommand("go", "mod", "edit", "-go=1.18") - _ = runCommand("go", "get", "-u", "apigo.cloud/git/apigo/gojs") - _ = runCommand("go", "get", "-u", "apigo.cloud/git/apigo/plugins") + _ = runCommand("go", "get", "-u", "apigo.cc/apigo/gojs") + _ = runCommand("go", "get", "-u", "apigo.cc/apigo/plugins") writeFile(".gitignore", gitignoreTPL, map[string]any{"name": name}) _ = runCommand("go", "mod", "tidy") @@ -393,7 +393,7 @@ func initPluginProject(args []string) { if name := checkProjectPath(); name != "" { _ = runCommand("go", "mod", "init", name) _ = runCommand("go", "mod", "edit", "-go=1.18") - _ = runCommand("go", "get", "-u", "apigo.cloud/git/apigo/plugin") + _ = runCommand("go", "get", "-u", "apigo.cc/apigo/plugin") writeFile("plugin.go", pluginCodeTPL, map[string]any{"name": name}) writeFile(".gitignore", gitignoreTPL, map[string]any{"name": name}) _ = runCommand("go", "mod", "tidy") @@ -403,8 +403,8 @@ func initPluginProject(args []string) { _ = runCommand("go", "mod", "edit", "-go=1.18") _ = runCommand("go", "mod", "edit", "-require=current-plugin@v0.0.0") _ = runCommand("go", "mod", "edit", "-replace=current-plugin@v0.0.0=../") - _ = runCommand("go", "get", "-u", "apigo.cloud/git/apigo/plugin") - _ = runCommand("go", "get", "-u", "apigo.cloud/git/apigo/gojs") + _ = runCommand("go", "get", "-u", "apigo.cc/apigo/plugin") + _ = runCommand("go", "get", "-u", "apigo.cc/apigo/gojs") writeFile("plugin_test.go", pluginTestCodeTPL, map[string]any{"name": name}) writeFile("plugin_test.js", pluginTestJSCodeTPL, map[string]any{"name": name}) _ = runCommand("go", "mod", "tidy") diff --git a/templates/_main.go b/templates/_main.go index de7e6af..6241a0d 100644 --- a/templates/_main.go +++ b/templates/_main.go @@ -1,7 +1,7 @@ package main import ( - "apigo.cloud/git/apigo/gojs" + "apigo.cc/apigo/gojs" ) func main() { diff --git a/templates/_main_test.go b/templates/_main_test.go index 94cadcc..16d3ab9 100644 --- a/templates/_main_test.go +++ b/templates/_main_test.go @@ -1,7 +1,7 @@ package main_test import ( - "apigo.cloud/git/apigo/gojs" + "apigo.cc/apigo/gojs" "github.com/ssgo/u" "testing" ) diff --git a/templates/_makePluginCode.go b/templates/_makePluginCode.go index a39bbba..398ea05 100644 --- a/templates/_makePluginCode.go +++ b/templates/_makePluginCode.go @@ -1,8 +1,8 @@ package main import ( - "apigo.cloud/git/apigo/gojs" - "apigo.cloud/git/apigo/plugin" + "apigo.cc/apigo/gojs" + "apigo.cc/apigo/plugin" "fmt" "github.com/ssgo/u" "path/filepath" diff --git a/templates/_plugin.go b/templates/_plugin.go index b2dfb5e..77c1506 100644 --- a/templates/_plugin.go +++ b/templates/_plugin.go @@ -1,7 +1,7 @@ package {{.name}} import ( - "apigo.cloud/git/apigo/plugin" + "apigo.cc/apigo/plugin" "errors" "github.com/ssgo/log" "github.com/ssgo/u" diff --git a/templates/_plugin_test.go b/templates/_plugin_test.go index ad5e857..3cf8a59 100644 --- a/templates/_plugin_test.go +++ b/templates/_plugin_test.go @@ -1,7 +1,7 @@ package {{.name}}_test import ( -"apigo.cloud/git/apigo/gojs" +"apigo.cc/apigo/gojs" _ "current-plugin" "fmt" "github.com/ssgo/u"