Shorten if
s again
This commit is contained in:
parent
cc5b00f0d0
commit
ddb763e06b
1 changed files with 2 additions and 6 deletions
8
run.sh
8
run.sh
|
@ -32,11 +32,7 @@ runcmd () {
|
||||||
}
|
}
|
||||||
|
|
||||||
main () {
|
main () {
|
||||||
if [[ "$1" == "--help" ]] || [[ "$1" == "" ]]
|
[[ "$1" == "--help" || "$1" == "" ]] && help && exit 0
|
||||||
then
|
|
||||||
help
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
chrdir=$(readlink -f "$1")
|
chrdir=$(readlink -f "$1")
|
||||||
chrcmd="${2:-/bin/bash}"
|
chrcmd="${2:-/bin/bash}"
|
||||||
|
@ -50,7 +46,7 @@ main () {
|
||||||
|
|
||||||
sourced () {
|
sourced () {
|
||||||
[ -n "$ZSH_VERSION" ] && [[ "$ZSH_EVAL_CONTEXT" =~ :file ]] && return 0
|
[ -n "$ZSH_VERSION" ] && [[ "$ZSH_EVAL_CONTEXT" =~ :file ]] && return 0
|
||||||
[ -n "$BASH_VERSION" ] && ! [ "$0" = "$BASH_SOURCE" ] && return 0
|
[ -n "$BASH_VERSION" ] && [[ "$0" != "$BASH_SOURCE" ]] && return 0
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue