|
|
@ -101,23 +101,23 @@ func main() {
|
|
|
|
select {}
|
|
|
|
select {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// // getLatestVersion fetches the latest version number from a given URL.
|
|
|
|
// getLatestVersion fetches the latest version number from a given URL.
|
|
|
|
// func getLatestVersion(url string) (string, error) {
|
|
|
|
/* func getLatestVersion(url string) (string, error) {
|
|
|
|
// resp, err := http.Get(url)
|
|
|
|
resp, err := http.Get(url)
|
|
|
|
// if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
// return "", err
|
|
|
|
return "", err
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// defer resp.Body.Close()
|
|
|
|
defer resp.Body.Close()
|
|
|
|
|
|
|
|
|
|
|
|
// location := resp.Header.Get("Location")
|
|
|
|
// location := resp.Header.Get("Location")
|
|
|
|
// if location == "" {
|
|
|
|
// if location == "" {
|
|
|
|
// return defaultTemplateVersion, nil
|
|
|
|
// return defaultTemplateVersion, nil
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// // Extract the version number from the URL
|
|
|
|
// Extract the version number from the URL
|
|
|
|
// latestVersion := filepath.Base(location)
|
|
|
|
latestVersion := filepath.Base(location)
|
|
|
|
// return latestVersion, nil
|
|
|
|
return latestVersion, nil
|
|
|
|
// }
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
// downloadAndExtract downloads a file from a URL and extracts it to a destination directory.
|
|
|
|
// downloadAndExtract downloads a file from a URL and extracts it to a destination directory.
|
|
|
|
func downloadAndExtract(url, destDir string) error {
|
|
|
|
func downloadAndExtract(url, destDir string) error {
|
|
|
|