Fix non-idempotent setup.sh
The setup.sh scripts in user-scripts aren't idempotent; they install to a different path depending on whether they were previously installed. Attached is a patch that fixes this.
Updated by Jeremy Rand about 2 years ago
Kurtis Hanna wrote:
I don't quite understand this issue. Can you explain it a bit more Jeremy?
An idempotent script is defined as a script that does the same thing when run twice as when run once. For example, if you run an installer twice, the 2nd time you run it shouldn't change anything since it's already installed. All installer scripts should be idempotent.
Unfortunately, the install scripts in user-scripts are not idempotent. The first time you install it, it installs to a different directory than the second time you install it. This can cause user confusion, e.g. if the user runs the installer, and then tries to later install a newer version, the older and newer versions will both be simultaneously installed (and the path that the user is accustomed to using will still be running the old version).
This patch fixes the issue by making sure that the first installation always installs to the same directory as any subsequent installations.