mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Remove empty output on last download
This commit is contained in:
parent
e0069a10e0
commit
d27fc67288
2 changed files with 12 additions and 7 deletions
|
|
@ -218,8 +218,8 @@ func archive(urls []string) error {
|
|||
}
|
||||
out.Empty()
|
||||
|
||||
for _, season := range episodes {
|
||||
for _, info := range season {
|
||||
for j, season := range episodes {
|
||||
for k, info := range season {
|
||||
var filename string
|
||||
var writeCloser io.WriteCloser
|
||||
if c != nil {
|
||||
|
|
@ -253,8 +253,11 @@ func archive(urls []string) error {
|
|||
}
|
||||
return err
|
||||
}
|
||||
|
||||
writeCloser.Close()
|
||||
|
||||
if i != len(urls)-1 || j != len(episodes)-1 || k != len(season)-1 {
|
||||
out.Empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
if c != nil {
|
||||
|
|
@ -420,7 +423,6 @@ func archiveInfo(info formatInformation, writeCloser io.WriteCloser, filename st
|
|||
signal.Stop(sig)
|
||||
out.Debug("Stopped signal catcher")
|
||||
|
||||
out.Empty()
|
||||
out.Empty()
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -147,8 +147,8 @@ func download(urls []string) error {
|
|||
}
|
||||
out.Empty()
|
||||
|
||||
for _, season := range episodes {
|
||||
for _, info := range season {
|
||||
for j, season := range episodes {
|
||||
for k, info := range season {
|
||||
dir := info.Format(downloadDirectoryFlag)
|
||||
if _, err = os.Stat(dir); os.IsNotExist(err) {
|
||||
if err = os.MkdirAll(dir, 0777); err != nil {
|
||||
|
|
@ -166,6 +166,10 @@ func download(urls []string) error {
|
|||
return err
|
||||
}
|
||||
file.Close()
|
||||
|
||||
if i != len(urls)-1 || j != len(episodes)-1 || k != len(season)-1 {
|
||||
out.Empty()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -253,7 +257,6 @@ func downloadInfo(info formatInformation, file *os.File) error {
|
|||
signal.Stop(sig)
|
||||
out.Debug("Stopped signal catcher")
|
||||
|
||||
out.Empty()
|
||||
out.Empty()
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue