From 2355282d8809d6a9a087c53b282690d1cd1b9826 Mon Sep 17 00:00:00 2001 From: Narvin Singh Date: Mon, 28 Dec 2020 11:06:03 -0500 Subject: [PATCH] Fix: Change module function names to be unique The code for each module is wrapped in a function so the module can be parameterized, and so its variables can be scoped to the function. However, the function names must be unique, otherwise when the modules are sourced, functions will overwrite functions with the same name in previously sourced modules. --- module/bat | 4 +--- module/dt | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/module/bat b/module/bat index 7ef687f..a0de3d0 100755 --- a/module/bat +++ b/module/bat @@ -1,6 +1,6 @@ #!/bin/bash -run () { +mod_bat () { # Customizable configuration constants local -r DEFAULT_CNT=1 local -r DEFAULT_PRE_PLG=' ' @@ -53,5 +53,3 @@ run () { printf '%b' "${res:1}" } -run "$@" - diff --git a/module/dt b/module/dt index 576591a..b9696ae 100755 --- a/module/dt +++ b/module/dt @@ -1,6 +1,6 @@ #!/bin/bash -run () { +mod_dt () { # Customizable configuration constants local -r DEFAULT_FMT='%a %d %I:%M%p' local -r DEFAULT_PRE='' @@ -13,5 +13,3 @@ run () { printf '%b%b%b' "${pre}" "$(date +"${fmt}")" "${suf}" } -run "$@" -