feat: Minor changes

This commit is contained in:
ge 2022-06-07 22:06:37 +03:00
parent f779aa82b5
commit 2bf83b6ddb
5 changed files with 19 additions and 19 deletions

View File

@ -25,13 +25,13 @@ __tar_options='-acf'
__tar_exclude= __tar_exclude=
__name_date_fmt='_%Y%m%d-%H%M' __name_date_fmt='_%Y%m%d-%H%M'
__compression='gzip' __compression='gzip'
BBLIBRARY="${BBLIBRARY:-./lib}" LIBRARY="${LIBRARY:-./lib}"
# Source library # Source library
if [ -f "$BBLIBRARY/lib.sh" ]; then if [ -f "$LIBRARY/lib.sh" ]; then
. "$BBLIBRARY/lib.sh" . "$LIBRARY/lib.sh"
else else
echo "Error: Cannot source library from $BBLIBRARY" >&2 echo "Error: Cannot source library from $LIBRARY" >&2
exit 1 exit 1
fi fi
@ -49,7 +49,7 @@ Options:
-V, --version print version and exit. -V, --version print version and exit.
Environment: Environment:
BBLIBRARY path to bb library [current: $BBLIBRARY] LIBRARY path to bb library [current: $LIBRARY]
EOF EOF
} }
@ -140,24 +140,24 @@ for script in "${__args[@]}"; do
# Run prepare() before all if set # Run prepare() before all if set
if is_function_set prepare; then 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 prepare
unset prepare unset prepare
fi fi
# Run user defined backup() if set or builtin_backup() # Run user defined backup() if set or builtin_backup()
if is_function_set backup; then 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 backup
unset backup unset backup
else else
echo -e "Run \e[1mbuiltin_backup()\e[0m ..." | log -p echo -e "Run \e[1mbuiltin_backup()\e[0m" | log -p
builtin_backup builtin_backup
fi fi
# Run post backup function if set # Run post backup function if set
if is_function_set finalise; then 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 finalise
unset finalise unset finalise
fi fi

View File

@ -98,7 +98,7 @@ builtin_backup() {
# ---------------------------------------------------------- # # ---------------------------------------------------------- #
gen_backup_name() { 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 # Usage: gen_backup_name NAME_EXT

View File

@ -22,7 +22,7 @@ handler::cp() {
# #
# Usage: handler::cp URI # Usage: handler::cp URI
log "Run handler handler::cp() ..." log "Run handler handler::cp()"
local uri local uri
local dst_path local dst_path

View File

@ -21,7 +21,7 @@ handler::tar() {
# #
# Usage: handler::tar URI # Usage: handler::tar URI
log "Run handler handler::tar() ..." log "Run handler handler::tar()"
local uri local uri
local src_path local src_path

View File

@ -16,11 +16,11 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
BBLIBRARY="${BBLIBRARY:-./lib}" LIBRARY="${LIBRARY:-./lib}"
. "$BBLIBRARY/common.sh" . "$LIBRARY/common.sh"
. "$BBLIBRARY/backup.sh" . "$LIBRARY/backup.sh"
. "$BBLIBRARY/source.sh" . "$LIBRARY/source.sh"
. "$BBLIBRARY/uri.sh" . "$LIBRARY/uri.sh"
. "$BBLIBRARY/handlers/tar.sh" . "$LIBRARY/handlers/tar.sh"
. "$BBLIBRARY/handlers/cp.sh" . "$LIBRARY/handlers/cp.sh"