code refactoring

This commit is contained in:
2023-07-26 16:21:10 +02:00
parent a4d586a3a0
commit d4f656fd87
6 changed files with 20 additions and 70 deletions

View File

@@ -6,13 +6,14 @@ import (
"github.com/marcopeocchi/yt-dlp-web-ui/server/config"
)
var path = config.Instance().GetConfig().DownloaderPath
// Update using the builtin function of yt-dlp
func UpdateExecutable() error {
cmd := exec.Command(path, "-U")
cmd.Start()
cmd := exec.Command(config.Instance().GetConfig().DownloaderPath, "-U")
err := cmd.Wait()
return err
err := cmd.Start()
if err != nil {
return err
}
return cmd.Wait()
}