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 () {
|
||||
if [[ "$1" == "--help" ]] || [[ "$1" == "" ]]
|
||||
then
|
||||
help
|
||||
exit 0
|
||||
fi
|
||||
[[ "$1" == "--help" || "$1" == "" ]] && help && exit 0
|
||||
|
||||
chrdir=$(readlink -f "$1")
|
||||
chrcmd="${2:-/bin/bash}"
|
||||
|
@ -50,7 +46,7 @@ main () {
|
|||
|
||||
sourced () {
|
||||
[ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue