#colored warning warn() { printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n" } all_off="$(tput sgr0)" bold="${all_off}$(tput bold)" blue="${bold}$(tput setaf 4)" yellow="${bold}$(tput setaf 3)" post_install() { echo "Applying notion-enhancer automatically..." warn "If you want to use the enhancer without running sudo (recommended by the developer), then run \n chmod -R a+wr /usr/lib/node_modules/notion-enhancer/ /opt/notion-app/app /usr/share/applications/notion-app.desktop /usr/bin/notion-app \n However, be wary of the security risks posed by such patch." notion-enhancer apply -y } post_upgrade() { if [[ "$(notion-enhancer check)" == *" not "* ]]; then echo "Notion-enhancer is not applied, skipping" else echo "Reapplying notion-enhancer" notion-enhancer remove -n # don't delete the data notion-enhancer apply -y # yes, overwrite warn "If you want to use the enhancer without running sudo (recommended by the developer), then run: \n chmod -R a+wr /usr/lib/node_modules/notion-enhancer/ /opt/notion-app/app /usr/share/applications/notion-app.desktop /usr/bin/notion-app \n However, be wary of the security risks posed by such patch." fi } pre_remove() { echo "Disabling notion-enhancer..." warn "The data folder will NOT be deleted" notion-enhancer remove -n }