Improve rc/ scripts
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# $LWS/rc/functions.sh
|
||||
|
||||
function xlog() {
|
||||
if (( $LWS_DEBUG )); then
|
||||
if true_false "$LWS_DEBUG"; then
|
||||
echo "$@"
|
||||
fi
|
||||
}
|
||||
@@ -33,7 +33,7 @@ function append_path() {
|
||||
|
||||
function append_path_try() {
|
||||
if [[ -e "$1" ]]; then
|
||||
append_pat "$1"
|
||||
append_path "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -69,13 +69,17 @@ function can_run() {
|
||||
function source_directory() {
|
||||
local mask="$1"
|
||||
for file in $mask; do
|
||||
if [[ -f "$file" ]]; then
|
||||
if [[ -e "$file" ]]; then
|
||||
xlog "LOAD $file"
|
||||
source "$file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function source_directory_sh() {
|
||||
source_directory "$1/*.sh"
|
||||
}
|
||||
|
||||
# use: dump_args "$@"
|
||||
function dump_args() {
|
||||
for i in $*; do
|
||||
|
||||
Reference in New Issue
Block a user