Skip to content

Commit 2599e0b

Browse files
authored
Include empty files in downloads (#1213)
1 parent 8d0bdbe commit 2599e0b

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

cmd/download.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ func runDownload(cfg config.Config, flags *pflag.FlagSet, args []string) error {
101101
// TODO: deal with it
102102
continue
103103
}
104-
// Don't bother with empty files.
105-
if res.Header.Get("Content-Length") == "0" {
106-
continue
107-
}
108104

109105
path := sf.relativePath()
110106
dir := filepath.Join(metadata.Dir, filepath.Dir(path))

cmd/download_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ func assertDownloadedCorrectFiles(t *testing.T, targetDir string) {
353353

354354
path := filepath.Join(targetDir, "bogus-track", "bogus-exercise", "file-3.txt")
355355
_, err := os.Lstat(path)
356-
assert.True(t, os.IsNotExist(err), "It should not write the file if empty.")
356+
assert.NoError(t, err)
357357
}
358358

359359
func TestDownloadError(t *testing.T) {

0 commit comments

Comments
 (0)