Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetsl committed Apr 17, 2021
1 parent c53d869 commit 9591b6f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion create_shortcut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Exec="${FULL_PATH}/Lotion"
Terminal=false
Categories=Office;TextEditor;Utility
Type=Application
Icon=${WORKING_DIR}/icon.png
Icon=${WORKING_DIR}/Lotion/resources/app/icon.png
StartupWMClass=Notion
EOS
chmod +x Notion_native.desktop
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ $command == 'web' ]]; then
wget https://github.com/puneetsl/lotion/releases/download/V-0.05/Lotion-web.tar.xz
tar xvf $PD/Lotion-web.tar.xz -C $INSTALL_DIR --strip 1
rm Lotion-web.tar.xz
/bin/bash $PD/create_shortcut.sh Lotion
/bin/bash $PD/create_shortcut.sh $command
echo done
exit 0
fi
Expand Down
25 changes: 21 additions & 4 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@

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
Expand All @@ -12,11 +24,11 @@ uninstall_prep() {
share_dir="/usr/share"

if [[ -d ${share_dir}/lotion ]]; then
install_dir="${share_dir}/lotion"
install_dir="${share_dir}/lotion-$command"
shortcut_dir="${share_dir}/applications"
exec_dir="/usr/bin"
else
install_dir="$(pwd)/Lotion"
install_dir="$(pwd)/Lotion-$command"
shortcut_dir="$HOME/.local/share/applications"
exec_dir="$HOME/.local/bin"
fi
Expand All @@ -30,10 +42,15 @@ delete_directory() {
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}/Lotion.desktop" "${exec_dir}/lotion" "${exec_dir}/lotion_uninstall")
files=("${shortcut_dir}/${shortcut_file}" "${exec_dir}/lotion-$command" "${exec_dir}/lotion_uninstall")

for file in "${files[@]}"; do
if [[ -f "${file}" ]]; then
Expand Down

0 comments on commit 9591b6f

Please sign in to comment.