fix(init): rewrite theme blob url to raw url

This commit is contained in:
Jan De Dobbeleer 2024-10-04 14:06:00 +02:00 committed by Jan De Dobbeleer
parent c30b613167
commit dba953a0a7

View file

@ -17,6 +17,10 @@ import (
func Download(cachePath, url string) (string, error) { func Download(cachePath, url string) (string, error) {
defer log.Trace(time.Now(), cachePath, url) defer log.Trace(time.Now(), cachePath, url)
// some users use the blob url, we need to convert it to the raw url
themeBlob := "https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/"
url = strings.Replace(url, themeBlob, "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/", 1)
configPath, shouldUpdate := shouldUpdate(cachePath, url) configPath, shouldUpdate := shouldUpdate(cachePath, url)
if !shouldUpdate { if !shouldUpdate {
return configPath, nil return configPath, nil