forked from mirrored-repos/manjaro-tools
[util-msg] add error handling for import()
This commit is contained in:
parent
6ed34f132f
commit
f98c71927b
1 changed files with 8 additions and 4 deletions
|
@ -11,10 +11,6 @@
|
|||
export LC_MESSAGES=C
|
||||
export LANG=C
|
||||
|
||||
import(){
|
||||
[[ -r $1 ]] && source $1
|
||||
}
|
||||
|
||||
# check if messages are to be printed using color
|
||||
unset ALL_OFF BOLD BLUE GREEN RED YELLOW CYAN MAGENTA WHITE
|
||||
if [[ -t 2 ]]; then
|
||||
|
@ -118,3 +114,11 @@ slock() {
|
|||
stat_done
|
||||
fi
|
||||
}
|
||||
|
||||
import(){
|
||||
if [[ -r $1 ]];then
|
||||
source $1
|
||||
else
|
||||
die "Could not import $1"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue