This is an automated email from the ASF dual-hosted git repository.
hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-gateway.git
The following commit(s) were added to refs/heads/master by this push:
new b4d745c fix: improve upload cdn print
b4d745c is described below
commit b4d745cc0ef9ee607414ef06d509c857565c8d55
Author: Yang Luo <[email protected]>
AuthorDate: Tue Apr 28 02:59:11 2026 +0800
fix: improve upload cdn print
---
run/cdn.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/run/cdn.go b/run/cdn.go
index 82f1bef..0bcd2e7 100644
--- a/run/cdn.go
+++ b/run/cdn.go
@@ -62,14 +62,13 @@ func uploadFolder(provider storage.StorageProvider,
buildDir string, folder stri
return "", err
}
- fmt.Printf("uploadFolder(): Uploaded [%s] to [%s]\n",
filepath.Join(path, filename), objectKey)
-
index := strings.Index(fileUrl, "/static")
if index == -1 {
return "", fmt.Errorf("uploadFolder() error, fileUrl
should contain \"/static/\", fileUrl = %s", fileUrl)
}
domainUrl = fileUrl[:index+len("/static")] + "/"
+ fmt.Printf("uploadFolder(): [/%s] -> [%s]\n", objectKey,
fileUrl)
}
return domainUrl, nil
@@ -78,10 +77,11 @@ func uploadFolder(provider storage.StorageProvider,
buildDir string, folder stri
func updateHtml(domainUrl string, buildDir string) {
htmlPath := filepath.Join(buildDir, "index.html")
html := util.ReadStringFromPath(htmlPath)
+
html = strings.Replace(html, "\"/static/", fmt.Sprintf("\"%s",
domainUrl), -1)
util.WriteStringToPath(html, htmlPath)
- fmt.Printf("Updated HTML to: [%s]\n", html)
+ fmt.Printf("updateHtml(): index.html content:\n%s\n%s\n%s\n",
strings.Repeat("=", 80), html, strings.Repeat("=", 80))
}
func gitUploadCdn(providerName string, siteName string) error {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]