Newsletter exercise: `assets/empty.txt` file not being created

Hi! I was solving the Newsletter exercise in Elixir.

I got confused because my first iteration passed the local tests but failed once submitted. After that I found out that the assets/empty.txt file isn’t created when I download the exercise. Is it a problem just for me? Did it happened to anyone else?

Here you can see my solutions. The last one passed both tests (local and online) after I manually created the empty file.

By design, the Exercism CLI doesn’t download empty files so that’d most likely explain the missing text file locally. Perhaps, a note in the exercise instructions is warranted for students solving the exercie locally.

Since this isn’t in the Elixir subforum, the maintainers might not see this thread. CC @angelikatyborska @jiegillet @neenjaw

1 Like

Thank you for tagging me!

I can confirm this problem is happening to me too. There are two extra text files in this exercise:

$ ls -al exercises/concept/newsletter/assets 
total 8
drwxr-xr-x   4 angelika  staff   128B Nov 27  2021 .
drwxr-xr-x  11 angelika  staff   352B Aug 10  2024 ..
-rw-r--r--   1 angelika  staff    71B Nov 27  2021 emails.txt
-rw-r--r--   1 angelika  staff     0B Nov 27  2021 empty.txt

When I download the exercise via the CLI, it only downloads the emails.txt file.

By design, the Exercism CLI doesn’t download empty files so that’d most likely explain the missing text file locally.

@BNAndras Do you know why? Usually files exist for a reason, even if they are empty. I find this to be a surprising choice.

Anyway, I should be able to fix this by adding some white space to the file.

If we want empty files, it’s simply a matter of deleting those four lines (and the one line from the unit test that checks this).

No one seems to feel strongly that empty files should be preserved, so… here’s a PR to change that.

Adding anything to a file that is “empty.txt” seems counter-intuitive, since then it will not be an empty file.

Probably better to either remove lines 104-107 of download.go or make an exception for any file called empty.txt, as by name (and definition, and intention) it violates the length of 0 check there.

14 hours is likely not long enough to find out if people feel strongly about empty files, it has not been long enough for some to respond. ;)

See also CLI doesn't download empty stubs from 4 days ago