Ah, wow. I like that they ported the accidental behavior deliberately into Windows:
Warning: The uninstallation process deletes the folder Steam was installed to to ensure it is fully uninstalled. If you accidentally installed Steam to a folder containing other data, for example C:\Program Files (x86)\ instead of C:\Program Files (x86)\Steam\..."
I'm probably being too judgemental, but I don't get how people are so nonchalant about mutability and potentially destructive commands. Even in a Github Gist I'm scared enough to set -euo pipefail, put half a dozen checks before removing a folder...
Oh I do love reading those... Shame that shell scripting is still treated as mysterious command line voodoo, even Microsoft has Powershell now showing how powerful the concept is that even they couldn't avoid it entirely
And use the so-called "Bash unofficial strict mode", as described elsewhere.
I prefer this summary of it, because the original includes stuff like changing IFS (the fields separators) which I agree with the Gist author to not include, because it is a Bad Idea to blindly suggest it universally.
I can't ever imagine using it tho :) If my bash scripts are so complex or critical that I feel the need to type check, I will probably use another scripting language where I can do that more easily while still having readable code.
It's not that cut & dry, as bash is doing evaluations; 0 and 1 can both be "true" if simply used without an evaluation, but add logic and it starts to matter (grep returns 0 if hit, 1 if not).
I used to somehow think Bash scripts were ideal given that they were fairly transparent, but I'll take a Go app or Rust program anyday now over something written in shell script. shfmt is an example.