Commit 4b40a3a5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

play.d/common.sh: major clean up

parent 3801cd47
......@@ -6,33 +6,34 @@ fatal()
exit 1
}
if [ "$1" = "--remove" ] ; then
epm remove $PKGNAME
exit
fi
if [ "$1" = "--package" ] ; then
echo "$PKGNAME"
exit
fi
if [ "$1" = "--installed" ] ; then
epm installed $PKGNAME
exit
fi
if [ "$1" = "--description" ] ; then
echo "$DESCRIPTION"
exit
fi
[ "$1" != "--run" ] && [ "$1" != "--update" ] && fatal "Unknown command $1"
if [ "$1" = "--update" ] ; then
if ! epm installed $PKGNAME ; then
echo "Skipping update of $PKGNAME (package is not installed)"
exit
fi
fi
case "$1" in
"--remove")
epm remove $PKGNAME
exit
;;
"--package")
echo "$PKGNAME"
exit
;;
"--installed")
epm installed $PKGNAME
exit
;;
"--description")
echo "$DESCRIPTION"
exit
;;
"--update")
if ! epm installed $PKGNAME ; then
echo "Skipping update of $PKGNAME (package is not installed)"
exit
fi
;;
"--run")
# just pass
;;
*)
fatal "Unknown command $1"
;;
esac
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment