Clean + fixup

This commit is contained in:
Bryan 2016-05-18 09:32:48 -07:00
parent 13d760c6a4
commit 584bd3e72d
2 changed files with 4 additions and 10 deletions

View file

@ -8,7 +8,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
current_user=$(whoami)
if [ $current_user != "root" ]; then
echo "$(basename $0) uninstallation script requires superuser privileges to run"
echo "$(basename "$0") uninstallation script requires superuser privileges to run"
exit 1
fi

View file

@ -8,7 +8,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
current_user=$(whoami)
if [ $current_user != "root" ]; then
echo "`basename "$0"` uninstallation script requires superuser privileges to run"
echo "$(basename "$0") uninstallation script requires superuser privileges to run"
exit 1
fi
@ -17,9 +17,6 @@ dotnet_pkg_name_suffix="com.microsoft.dotnet"
dotnet_install_root="/usr/local/share/dotnet"
dotnet_path_file="/etc/paths.d/dotnet"
# nuget paths
nuget_root=~/.nuget
remove_dotnet_pkgs(){
installed_pkgs=($(pkgutil --pkgs | grep $dotnet_pkg_name_suffix))
@ -34,11 +31,8 @@ remove_dotnet_pkgs
[ "$?" -ne 0 ] && echo "Failed to remove dotnet packages." && exit 1
echo "Deleting install root - $dotnet_install_root"
rm -rf $dotnet_install_root
rm -f $dotnet_path_file
echo "Deleting NuGet package location"
rm -rf $nuget_root
rm -r "$dotnet_install_root"
rm "$dotnet_path_file"
echo "dotnet packages removal succeeded."
exit 0