Files
localsend--localsend/scripts/remove_proprietary_dependencies.sh
wehub-resource-sync bb087aad19
CI / format (push) Failing after 2s
CI / packaging (push) Failing after 0s
CI / test (push) Failing after 3s
chore: import upstream snapshot with attribution
2026-07-13 11:58:56 +08:00

31 lines
882 B
Bash
Executable File

#!/bin/sh
# This script removes proprietary dependencies from the project.
cd app
REGEX_A="s/\/\/ \[FOSS_REMOVE_START\]/\/*/"
REGEX_B="s/\/\/ \[FOSS_REMOVE_END\]/\*\//"
# Remove lines from pubspec.yaml
sed -i '/# \[FOSS_REMOVE\]/d' pubspec.yaml
# Comment out parts in Dart files
sed -i "$REGEX_A" lib/config/init.dart
sed -i "$REGEX_B" lib/config/init.dart
sed -i "$REGEX_A" lib/pages/donation/donation_page.dart
sed -i "$REGEX_B" lib/pages/donation/donation_page.dart
sed -i "$REGEX_A" lib/pages/donation/donation_page_vm.dart
sed -i "$REGEX_B" lib/pages/donation/donation_page_vm.dart
# Remove files completely
rm lib/provider/purchase_provider.dart
# Refer to donationPageNoopVmProvider instead of donationPageVmProvider
sed -i 's/donationPageVmProvider/donationPageNoopVmProvider/g' lib/pages/donation/donation_page.dart
cd ..
echo "Proprietary dependencies removed."