Shorter sourced() code
This commit is contained in:
parent
350ef0cb51
commit
bc6e29c3fb
1 changed files with 2 additions and 9 deletions
11
run.sh
11
run.sh
|
@ -64,15 +64,8 @@ main () {
|
||||||
}
|
}
|
||||||
|
|
||||||
sourced () {
|
sourced () {
|
||||||
if [ -n "$ZSH_VERSION" ]
|
[ -n "$ZSH_VERSION" ] && [[ "$ZSH_EVAL_CONTEXT" =~ :file ]] && return 0
|
||||||
then
|
[ -n "$BASH_VERSION" ] && ! [ "$0" = "$BASH_SOURCE" ] && return 0
|
||||||
case $ZSH_EVAL_CONTEXT in
|
|
||||||
*:file*) return 0;;
|
|
||||||
esac
|
|
||||||
elif [ -n "$BASH_VERSION" ]
|
|
||||||
then
|
|
||||||
! [ "$0" = "$BASH_SOURCE" ] && return 0
|
|
||||||
fi
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue