Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't uninstall from ./uninstall.sh #113

Open
mohammadhany opened this issue Aug 20, 2022 · 1 comment
Open

Can't uninstall from ./uninstall.sh #113

mohammadhany opened this issue Aug 20, 2022 · 1 comment

Comments

@mohammadhany
Copy link

mohammadhany commented Aug 20, 2022

i Can't uninstall from ./uninstall.sh. i am using fedora linux and after installing i tried to uninstall but in vain

file:///home/mohammadhanyemara/Pictures/Screenshots/Screenshot%20from%202022-08-20%2012-43-08.png

@mohammadhany mohammadhany changed the title cant uninstall from ./uninstall.sh Can't uninstall from ./uninstall.sh Aug 20, 2022
@heeler-deer
Copy link

hi ,i'm using ubuntu and face the same challenge
i modify the uninstall.sh like that:

#!/usr/bin/env bash

export check="\xE2\x9C\x94"
export cross="\xE2\x9D\x8C"
command=$1
if [[  ! $command =~ native|web ]]; then
	printf "\nSelect which version you would want to uninstall:\n\n"
	select command in web native
	do
		if [[ $command =~ native|web ]]; then
			echo $command
			break
		else
			echo "Please input 1 or 2"
		fi
	done
fi
uninstall_prep() {
  export install_dir
  export shortcut_dir
  export exec_dir

  local share_dir
  share_dir="/usr/share"

  if [[ -d ${share_dir}/lotion ]]; then
    install_dir="${share_dir}/lotion-$command"
    shortcut_dir="${share_dir}/applications"
    exec_dir="/usr/bin"
  else
    install_dir="$(pwd)/Lotion-$command"
    shortcut_dir="/usr/share/applications"
    exec_dir="/usr/bin"
  fi
}

delete_directory() {
  if [[ -d "${install_dir}" ]]; then
    rm -Rf "${install_dir}" || exit
    echo -e "${check} ${install_dir} was successfully deleted."
  else
    echo -e "${cross} ${install_dir} directory was not found. Skipping."
  fi
}
if [[ $command == 'web' ]]; then
  shortcut_file=Lotion.desktop
else
  shortcut_file=Notion_native.desktop
fi

delete_files() {
  declare -a files
  files=("${shortcut_dir}/${shortcut_file}" "${exec_dir}/lotion-$command" "${exec_dir}/lotion_uninstall")

  for file in "${files[@]}"; do
    if [[ -f "${file}" ]]; then
      rm "${file}" || exit
      echo -e "${cross} ${file} was successfully deleted."
    else
      echo -e "${cross} ${file} was not found. Skipping."
    fi
  done
}

uninstall_prep
delete_directory
delete_files

you should modify last 2 lines in function uninstall_prep() for your path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants