Skip to content

Commit 93fe852

Browse files
committed
chore(project): update functions
1 parent 62489b4 commit 93fe852

3 files changed

Lines changed: 38 additions & 4 deletions

File tree

src/bb-functions.d/filesystem.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# FUNCTIONS
1818
# ==================================================================
1919
# ------------------------------------------------------------------
20-
# files::checkDir
20+
# files::checkCmd
2121
# ------------------------------------------------------------------
2222
files::checkCmd() { if command -v &> /dev/null; then return 0; else return 1; fi }
2323
# ------------------------------------------------------------------
@@ -35,8 +35,19 @@ files::checkSrc() { [[ -f "$1" || -d "$1" ]] && return 0 || return 1; }
3535
# ------------------------------------------------------------------
3636
# files::mkd
3737
# ------------------------------------------------------------------
38+
# shellcheck disable=SC2174
3839
files::mkd() { mkdir -m "$1" -p "${@:2}"; }
3940
# ------------------------------------------------------------------
41+
# files::scriptPath
42+
# ------------------------------------------------------------------
43+
# @description Determine the calling script's current path
44+
#
45+
# @noargs
46+
#
47+
# @stdout The calling script's current path
48+
# ------------------------------------------------------------------
49+
file::scriptPath() { printf '%s' "$(realpath "${BASH_SOURCE[0]}")"; }
50+
# ------------------------------------------------------------------
4051
# files::win2lin
4152
# ------------------------------------------------------------------
4253
# Convert an absolute Windows path to an absolute linux path
@@ -51,3 +62,11 @@ files::win2lin()
5162

5263
printf '%s' "$win_path"
5364
}
65+
# ==================================================================
66+
# ALIAS FUNCTIONS
67+
# ==================================================================
68+
checkCmd() { files::checkCmd; }
69+
checkDir() { files::checkDir "$1"; }
70+
checkFile() { files::checkFile "$1"; }
71+
checkSrc() { files::checkSrc "$1"; }
72+
mkd() { files::mkd "$@"; }

src/bb-functions.d/stdout.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,19 @@
1111
# License: MIT License
1212
# Copyright: Copyright © 2023 Darren (Ragdata) Poulton
1313
# ==================================================================
14+
# DEPENDENCIES
15+
# ==================================================================
16+
# ==================================================================
1417
# FUNCTIONS
1518
# ==================================================================
19+
# ------------------------------------------------------------------
20+
# stdout::echoAlias
21+
# ------------------------------------------------------------------
22+
# ------------------------------------------------------------------
23+
stdout::echoAlias()
24+
{
25+
local
26+
}
27+
# ==================================================================
28+
# ALIAS FUNCTIONS
29+
# ==================================================================

src/bb-functions.d/utility.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ utility::bashInit() { reset; exec sudo --login --user "$USER" /bin/bash -c "cd '
2929
# ------------------------------------------------------------------
3030
utility::checkBash() { [[ "${BASH_VERSION:0:1}" -lt 4 ]] && errorExit "This script requires a minimum Bash version of 4+"; }
3131
# ------------------------------------------------------------------
32-
# utility::checkCMD
32+
# utility::checkDeps
3333
# ------------------------------------------------------------------
34+
# @description Checks whether dependencencies listed in arg array are installed on the current system
3435
# ------------------------------------------------------------------
35-
utility::checkCMD()
36+
utility::checkDeps()
3637
{
3738
[[ $# -eq 0 ]] && return
3839
[[ ! $(is::array "$1") ]] && errorReturn "'$1' Not an Array!" 1
@@ -56,4 +57,4 @@ utility::checkRoot() { [[ "$EUID" -ne 0 ]] && errorExit "This script MUST be run
5657
bashInit() { utility::bashInit; }
5758
checkBash() { utility::checkBash; }
5859
checkRoot() { utility::checkRoot; }
59-
checkCMD() { utility::checkCMD "$@"; }
60+
checkDeps() { utility::checkDeps "$@"; }

0 commit comments

Comments
 (0)