Parcourir la source

Use more consistent and readable local variable names

Alois Mahdal il y a 7 ans
Parent
révision
f6333b29d8
1 fichiers modifiés avec 8 ajouts et 8 suppressions
  1. 8
    8
      src/saturnin.sh.skel

+ 8
- 8
src/saturnin.sh.skel Voir le fichier

@@ -311,19 +311,19 @@ saturnin__runhook() {
311 311
     # unless syntax check fails, execute it as Bash code (in separate
312 312
     # process).
313 313
     #
314
-    local hname="$1"    # hook name
315
-    local hook_code     # ... code
314
+    local name="$1"     # hook name
315
+    local code          # ... code
316 316
     test -n "$SATURNIN_SUBCOMMAND" || {
317
-        warn "unknown subcommand, ignoring hook: $hname"
317
+        warn "unknown subcommand, ignoring hook: $name"
318 318
         return 0
319 319
     }
320
-    hook_code="$(saturnin__conf -j "hook.$SATURNIN_SUBCOMMAND.$hname")"
321
-    debug -v SATURNIN_SUBCOMMAND hook_code hname
322
-    bash -n <<<"$hook_code" || {
323
-        warn "syntax errors, ignoring hook: $hname"
320
+    code="$(saturnin__conf -j "hook.$SATURNIN_SUBCOMMAND.$name")"
321
+    debug -v SATURNIN_SUBCOMMAND code name
322
+    bash -n <<<"$code" || {
323
+        warn "syntax errors, ignoring hook: $name"
324 324
         return 0
325 325
     }
326
-    eval "$hook_code"
326
+    eval "$code"
327 327
 }
328 328
 
329 329
 saturnin__runsc() {