mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-12 05:07:45 +02:00
scripts: fix sloppy/unpredictable cmd && this || that
statements
- be a bit more POSIX to avoid any potential issues when full shell stdout/err are redirected - actual logic chains remain unchanged
This commit is contained in:
@ -32,7 +32,14 @@
|
||||
# Pure bash dirname implementation
|
||||
getdir() {
|
||||
case "$1" in
|
||||
*/*) dir=${1%/*}; [ -z $dir ] && echo "/" || echo $dir ;;
|
||||
*/*)
|
||||
dir=${1%/*}
|
||||
if [ -z $dir ]; then
|
||||
echo "/"
|
||||
else
|
||||
echo $dir
|
||||
fi
|
||||
;;
|
||||
*) echo "." ;;
|
||||
esac
|
||||
}
|
||||
|
Reference in New Issue
Block a user