Skip to content

Commit e6c5c61

Browse files
authored
do not remove .pyc files that belong to main binary
1 parent 48f3704 commit e6c5c61

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

useful-tools/quick-sharun.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,15 @@ if [ "$DEPLOY_SYS_PYTHON" = 1 ]; then
17071707
exit 1
17081708
fi
17091709
if [ "$DEBLOAT_SYS_PYTHON" = 1 ]; then
1710-
find "$APPDIR"/shared/lib/"${1##*/}" -type f -name '*.pyc' -delete
1710+
(
1711+
cd "$APPDIR"/shared/lib/"${1##*/}"
1712+
for f in $(find ./ -type f -name '*.pyc' -print); do
1713+
case "$f" in
1714+
*/"$MAIN_BIN"*) :;;
1715+
*) [ ! -f "$f" ] || rm -f "$f";;
1716+
esac
1717+
done
1718+
)
17111719
fi
17121720
fi
17131721
if [ "$DEPLOY_FLUTTER" = 1 ]; then

0 commit comments

Comments
 (0)