wimpysworld / desktopify

Convert Ubuntu Server for Raspberry Pi into a Desktop
https://www.youtube.com/watch?v=umtZuUJOU38
MIT License
520 stars 89 forks source link

Added check if a desktop is already installed #9

Closed bigpod98 closed 4 years ago

bigpod98 commented 4 years ago

added check to see if a desktop is already installed also added a flag to check if user wants to force install desktop

abacao commented 4 years ago

With this code I cannot install a different Desktop Environment from the one I have previously installed right? Maybe we just want to check if (example) the mate desktop is already installed and prevent the re-installation without the -force option.

I would suggest changes to something like this

if [ "$(apt list --installed | grep $DESKTOP_ENVIRONMENT)" ] && [ "$FORCE" == 0 ]; then
  echo "[!] ERROR: Desktop already installed. To force install use -force or --force flags."
bigpod98 commented 4 years ago

--force flag should allow you to install another deskto-environment unless it has a bug which could also be the case(probably)

flexiondotorg commented 4 years ago

Thanks for contributing :smiley: I'll take this as is, but will be refactoring slightly to address the observation from @abacao.

bigpod98 commented 4 years ago

@flexiondotorg what i wanted to make is that people do not "bloat up" their system or remove the old desktop environment unless they absolutly want it