update alias function

This commit is contained in:
emmett1
2020-04-10 13:18:13 +08:00
parent 2651ad3188
commit 985f59fc97

12
scratch
View File

@@ -100,16 +100,20 @@ allinstalled() {
}
deps_alias() {
[ -f $ALIAS_FILE ] || {
[ -f "$ALIAS_FILE" ] || {
echo $@
return
}
while [ "$1" ]; do
getalias=$(grep -w ^$1 $ALIAS_FILE | awk '{print $2}')
echo ${getalias:-$1}
if [ "$(grep -w ^$1 $ALIAS_FILE)" ]; then
getalias=$(grep -w ^$1 $ALIAS_FILE | awk '{print $2}')
[ "$getalias" ] && echo "$getalias"
else
echo "$1"
fi
shift
unset getalias
done
unset getalias
}
get_depends() {