summarylogtreecommitdiffstats
path: root/notion-enhancer
blob: 10169e8062f5c5ccd2830478b0cf509366377828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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..."
    notion-enhancer apply -y
    warn "The installer will own the files necessary for it to work with chmod -R a+wr"
	chmod -R a+wr /usr/lib/node_modules/notion-enhancer/ /opt/notion-app/
	chmod a+wr   /usr/share/applications/notion-app.desktop /usr/bin/notion-app
}

post_upgrade() {
    if [[ "$(notion-enhancer check)" == *" not "* ]]; then
        echo "Notion-enhancer is not applied, skipping"
    else
        echo "Reapplying notion-enhancer"
        notion-enhancer apply -y
    fi
}

pre_remove() {
    echo "Disabling notion-enhancer..."
    warn "The data folder will NOT be deleted"
	notion-enhancer remove -n
}