mirror of
https://github.com/Superredstone/spotiflac-cli.git
synced 2026-03-07 20:18:07 +01:00
feat: add file exists check
This commit is contained in:
@@ -69,6 +69,16 @@ func (app *App) Download(url string, outputFile string, serviceString string, qu
|
||||
return err
|
||||
}
|
||||
|
||||
fileExists, err := FileExists(outputFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if fileExists {
|
||||
app.log("File " + outputFile + " already exists")
|
||||
return nil
|
||||
}
|
||||
|
||||
err = app.DownloadFromUrl(downloadUrl, outputFile)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user