Skip to content

Commit 319c358

Browse files
committed
ci: add postinst & postrm scripts to linux deb package
1 parent 46a2012 commit 319c358

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ jobs:
8585
Maintainer: AppFlowy
8686
Description: An Open Source Alternative to Notion\n' "${{ github.ref_name }}" > DEBIAN/control
8787
88+
# postinst script for creating symlink
89+
printf '#!/bin/bash
90+
if [ -e /usr/local/bin/appflowy ]; then
91+
echo "Symlink already exists, skipping."
92+
else
93+
echo "Creating Symlink in /usr/local/bin/appflowy"
94+
ln -s /opt/AppFlowy/app_flowy /usr/local/bin/appflowy
95+
fi' > DEBIAN/postinst
96+
chmod 0755 DEBIAN/postinst
97+
98+
# postrm script for cleaning up residuals
99+
printf '#!/bin/bash
100+
if [ -e /usr/local/bin/appflowy ]; then
101+
rm /usr/local/bin/appflowy
102+
fi' > DEBIAN/postrm
103+
chmod 0755 DEBIAN/postrm
104+
88105
mkdir -p usr/share/applications
89106
# Update Exec & icon path in desktop entry
90107
grep -rl "\[CHANGE_THIS\]" ./opt/AppFlowy/appflowy.desktop.temp | xargs sed -i "s/\[CHANGE_THIS\]/\/opt/"

0 commit comments

Comments
 (0)