Revision: 726
http://svn.savannah.gnu.org/viewvc/?view=rev&root=administration&revision=726
Author: iank
Date: 2023-12-14 11:32:27 -0500 (Thu, 14 Dec 2023)
Log Message:
-----------
style guide: mention idempotency
Modified Paths:
--------------
trunk/sviki/fsf/bash-style-guide.mdwn
Modified: trunk/sviki/fsf/bash-style-guide.mdwn
===================================================================
--- trunk/sviki/fsf/bash-style-guide.mdwn 2023-12-14 07:58:14 UTC (rev
725)
+++ trunk/sviki/fsf/bash-style-guide.mdwn 2023-12-14 16:32:27 UTC (rev
726)
@@ -369,6 +369,11 @@
# Good practices
+Make scripts be as idempotent as feasible. For example, a script to
+create a vm. If you run it twice, the 2nd time it should just succeed
+and say "vm already exists." `mv` is an enemy of idempotency, try to
+avoid or be thoughtful in using it.
+
Make variables set at the beginning of a script constant when possible.
```