From 2bf83b6ddb7c42f9756ddc5b56124b020f60b710 Mon Sep 17 00:00:00 2001 From: ge Date: Tue, 7 Jun 2022 22:06:37 +0300 Subject: [PATCH] feat: Minor changes --- src/boring-backup | 18 +++++++++--------- src/lib/backup.sh | 2 +- src/lib/handlers/cp.sh | 2 +- src/lib/handlers/tar.sh | 2 +- src/lib/lib.sh | 14 +++++++------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/boring-backup b/src/boring-backup index 37b70be..a07e24f 100755 --- a/src/boring-backup +++ b/src/boring-backup @@ -25,13 +25,13 @@ __tar_options='-acf' __tar_exclude= __name_date_fmt='_%Y%m%d-%H%M' __compression='gzip' -BBLIBRARY="${BBLIBRARY:-./lib}" +LIBRARY="${LIBRARY:-./lib}" # Source library -if [ -f "$BBLIBRARY/lib.sh" ]; then - . "$BBLIBRARY/lib.sh" +if [ -f "$LIBRARY/lib.sh" ]; then + . "$LIBRARY/lib.sh" else - echo "Error: Cannot source library from $BBLIBRARY" >&2 + echo "Error: Cannot source library from $LIBRARY" >&2 exit 1 fi @@ -49,7 +49,7 @@ Options: -V, --version print version and exit. Environment: - BBLIBRARY path to bb library [current: $BBLIBRARY] + LIBRARY path to bb library [current: $LIBRARY] EOF } @@ -140,24 +140,24 @@ for script in "${__args[@]}"; do # Run prepare() before all if set if is_function_set prepare; then - echo -e "Run \e[1mprepare()\e[0m ..." | log -p + echo -e "Run \e[1mprepare()\e[0m" | log -p prepare unset prepare fi # Run user defined backup() if set or builtin_backup() if is_function_set backup; then - echo -e "Run \e[1mbackup()\e[0m ..." | log -p + echo -e "Run \e[1mbackup()\e[0m" | log -p backup unset backup else - echo -e "Run \e[1mbuiltin_backup()\e[0m ..." | log -p + echo -e "Run \e[1mbuiltin_backup()\e[0m" | log -p builtin_backup fi # Run post backup function if set if is_function_set finalise; then - echo -e "Run \e[1mfinalise()\e[0m ..." | log -p + echo -e "Run \e[1mfinalise()\e[0m" | log -p finalise unset finalise fi diff --git a/src/lib/backup.sh b/src/lib/backup.sh index 3bba2e9..539a981 100644 --- a/src/lib/backup.sh +++ b/src/lib/backup.sh @@ -98,7 +98,7 @@ builtin_backup() { # ---------------------------------------------------------- # gen_backup_name() { - # Generate backup file name. Return (echo) string. + # Generate backup file name. Write resulting string to STDOUT. # # Usage: gen_backup_name NAME_EXT diff --git a/src/lib/handlers/cp.sh b/src/lib/handlers/cp.sh index 4776913..f5e61ef 100644 --- a/src/lib/handlers/cp.sh +++ b/src/lib/handlers/cp.sh @@ -22,7 +22,7 @@ handler::cp() { # # Usage: handler::cp URI - log "Run handler handler::cp() ..." + log "Run handler handler::cp()" local uri local dst_path diff --git a/src/lib/handlers/tar.sh b/src/lib/handlers/tar.sh index aa39d3b..70b58cd 100644 --- a/src/lib/handlers/tar.sh +++ b/src/lib/handlers/tar.sh @@ -21,7 +21,7 @@ handler::tar() { # # Usage: handler::tar URI - log "Run handler handler::tar() ..." + log "Run handler handler::tar()" local uri local src_path diff --git a/src/lib/lib.sh b/src/lib/lib.sh index 4630f0e..b81419c 100644 --- a/src/lib/lib.sh +++ b/src/lib/lib.sh @@ -16,11 +16,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -BBLIBRARY="${BBLIBRARY:-./lib}" +LIBRARY="${LIBRARY:-./lib}" -. "$BBLIBRARY/common.sh" -. "$BBLIBRARY/backup.sh" -. "$BBLIBRARY/source.sh" -. "$BBLIBRARY/uri.sh" -. "$BBLIBRARY/handlers/tar.sh" -. "$BBLIBRARY/handlers/cp.sh" +. "$LIBRARY/common.sh" +. "$LIBRARY/backup.sh" +. "$LIBRARY/source.sh" +. "$LIBRARY/uri.sh" +. "$LIBRARY/handlers/tar.sh" +. "$LIBRARY/handlers/cp.sh"