Skip to content

Comment on "So that a truncated partial download doesn't end up executing half a script"

Comments

I mean, could you put the main function at the top of the script, so that it calls later definitions?

The problem is that the script could be truncated in such a way that it executes successfully. It defines a bunch of functions and then quits.

If you're not checking for the success or failure of the download, you're probably not checking for the success or failure of the script; something is just going to assume the script worked.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.