chore: 优化下载静态文件失败提示信息

This commit is contained in:
tangtanglove
2023-04-12 14:31:55 +08:00
parent 7038ce9373
commit 44620698ff
2 changed files with 5 additions and 3 deletions

View File

@@ -19,8 +19,10 @@ const CONTENT = "https://raw.githubusercontent.com"
var urlPattern = regexp.MustCompile(`<a class="js-navigation-open.*?".*?title="(.*?)".*?href="(.*?)".*?>`)
var repositoryPattern = regexp.MustCompile(`(/.*?/.*?/)blob/(.*$)`)
var respositoryDownloadURL = ""
func Download(respositoryURL string, path string) {
respositoryDownloadURL = respositoryURL
if respositoryURL == "" {
fmt.Println("please specify the github url!")
return
@@ -50,7 +52,7 @@ func Download(respositoryURL string, path string) {
// failedPrint
func failedPrint(err error) {
if err != nil {
fmt.Println("Download static files failed! \n Please goto https://github.com/quarkcms/quark-go/tree/main/website url to download it \n After downloading, you must make 'install.lock' file in the website dir")
fmt.Println("The static file download failed. Please go to the url:" + respositoryDownloadURL + " to download and copy it to the project root directory, and create an install.lock lock file in the website directory.\n\n")
panic(err)
}
}