Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
feat: improve white label scripts on Windows (#7755)
Lucasa5eb2cdd9a01
diff --git a/frontend/appflowy_flutter/assets/fonts/FlowyIconData.ttf b/frontend/appflowy_flutter/assets/fonts/FlowyIconData.ttfdeleted file mode 100644index 8f03a5c8f9..0000000000Binary files a/frontend/appflowy_flutter/assets/fonts/FlowyIconData.ttf and /dev/null differdiff --git a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_avatar.dart b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_avatar.dartindex d5ecd09c38..59b7fbd39b 100644--- a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_avatar.dart+++ b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_avatar.dart@@ -27,7 +27,7 @@ class ChatAIAvatar extends StatelessWidget {child: const CircleAvatar(backgroundColor: Colors.transparent,child: FlowySvg(- FlowySvgs.flowy_logo_s,+ FlowySvgs.app_logo_s,size: Size.square(16),blendMode: null,),diff --git a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_welcome_page.dart b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_welcome_page.dartindex d7a90bd18a..30dc918f70 100644--- a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_welcome_page.dart+++ b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_welcome_page.dart@@ -46,7 +46,7 @@ class ChatWelcomePage extends StatelessWidget {mainAxisAlignment: MainAxisAlignment.center,children: [const FlowySvg(- FlowySvgs.flowy_logo_xl,+ FlowySvgs.app_logo_xl,size: Size.square(32),blendMode: null,),diff --git a/frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/logo/logo.dart b/frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/logo/logo.dartindex eb29807b5b..8e126db7ad 100644--- a/frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/logo/logo.dart+++ b/frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/logo/logo.dart@@ -12,7 +12,7 @@ class AFLogo extends StatelessWidget {@overrideWidget build(BuildContext context) {return FlowySvg(- FlowySvgs.flowy_logo_xl,+ FlowySvgs.app_logo_xl,blendMode: null,size: size,);diff --git a/frontend/appflowy_flutter/lib/user/presentation/screens/splash_screen.dart b/frontend/appflowy_flutter/lib/user/presentation/screens/splash_screen.dartindex 146bf06df1..71345aa8dd 100644--- a/frontend/appflowy_flutter/lib/user/presentation/screens/splash_screen.dart+++ b/frontend/appflowy_flutter/lib/user/presentation/screens/splash_screen.dart@@ -115,7 +115,7 @@ class Body extends StatelessWidget {return Container(alignment: Alignment.center,child: UniversalPlatform.isMobile- ? const FlowySvg(FlowySvgs.flowy_logo_xl, blendMode: null)+ ? const FlowySvg(FlowySvgs.app_logo_xl, blendMode: null): const _DesktopSplashBody(),);}diff --git a/frontend/appflowy_flutter/lib/user/presentation/screens/workspace_start_screen/mobile_workspace_start_screen.dart b/frontend/appflowy_flutter/lib/user/presentation/screens/workspace_start_screen/mobile_workspace_start_screen.dartindex 59b61aa54b..a6124da60b 100644--- a/frontend/appflowy_flutter/lib/user/presentation/screens/workspace_start_screen/mobile_workspace_start_screen.dart+++ b/frontend/appflowy_flutter/lib/user/presentation/screens/workspace_start_screen/mobile_workspace_start_screen.dart@@ -57,7 +57,7 @@ class _MobileWorkspaceStartScreenStatechildren: [const Spacer(),const FlowySvg(- FlowySvgs.flowy_logo_xl,+ FlowySvgs.app_logo_xl,size: Size.square(64),blendMode: null,),diff --git a/frontend/appflowy_flutter/lib/workspace/application/notification/notification_service.dart b/frontend/appflowy_flutter/lib/workspace/application/notification/notification_service.dartindex 7a19e2a822..3f9657c5cf 100644--- a/frontend/appflowy_flutter/lib/workspace/application/notification/notification_service.dart+++ b/frontend/appflowy_flutter/lib/workspace/application/notification/notification_service.dart@@ -1,8 +1,12 @@-import 'package:appflowy/generated/locale_keys.g.dart';-import 'package:easy_localization/easy_localization.dart';import 'package:flutter/foundation.dart';import 'package:local_notifier/local_notifier.dart';+/// The app name used in the local notification.+///+/// DO NOT Use i18n here, because the i18n plugin is not ready+/// before the local notification is initialized.+const _localNotifierAppName = 'AppFlowy';+/// Manages Local Notifications////// Currently supports:@@ -12,7 +16,11 @@ import 'package:local_notifier/local_notifier.dart';///class NotificationService {static Future<void> initialize() async {- await localNotifier.setup(appName: LocaleKeys.appName.tr());+ await localNotifier.setup(+ appName: _localNotifierAppName,+ // Don't create a shortcut on Windows, because the setup.exe will create a shortcut+ shortcutPolicy: ShortcutPolicy.requireNoCreate,+ );}}diff --git a/frontend/appflowy_flutter/lib/workspace/application/settings/appearance/desktop_appearance.dart b/frontend/appflowy_flutter/lib/workspace/application/settings/appearance/desktop_appearance.dartindex 2a707b6b2d..c1e539cf58 100644--- a/frontend/appflowy_flutter/lib/workspace/application/settings/appearance/desktop_appearance.dart+++ b/frontend/appflowy_flutter/lib/workspace/application/settings/appearance/desktop_appearance.dart@@ -14,6 +14,8 @@ class DesktopAppearance extends BaseAppearance {) {assert(codeFontFamily.isNotEmpty);+ fontFamily = fontFamily.isEmpty ? defaultFontFamily : fontFamily;+final isLight = brightness == Brightness.light;final theme = isLight ? appTheme.lightTheme : appTheme.darkTheme;diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_top_menu.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_top_menu.dartindex 559c189925..67930c336a 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_top_menu.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_top_menu.dart@@ -50,8 +50,8 @@ class SidebarTopMenu extends StatelessWidget {}final svgData = Theme.of(context).brightness == Brightness.dark- ? FlowySvgs.flowy_logo_dark_mode_xl- : FlowySvgs.flowy_logo_text_xl;+ ? FlowySvgs.app_logo_with_text_dark_xl+ : FlowySvgs.app_logo_with_text_light_xl;return Padding(padding: const EdgeInsets.only(top: 12.0, left: 8),diff --git a/frontend/appflowy_flutter/pubspec.yaml b/frontend/appflowy_flutter/pubspec.yamlindex e9dfbf48d0..8fe956a194 100644--- a/frontend/appflowy_flutter/pubspec.yaml+++ b/frontend/appflowy_flutter/pubspec.yaml@@ -254,9 +254,6 @@ flutter:uses-material-design: truefonts:- - family: FlowyIconData- fonts:- - asset: assets/fonts/FlowyIconData.ttf- family: Poppinsfonts:- asset: assets/google_fonts/Poppins/Poppins-ExtraLight.ttf@@ -282,6 +279,9 @@ flutter:- asset: assets/google_fonts/Roboto_Mono/RobotoMono-Regular.ttf- asset: assets/google_fonts/Roboto_Mono/RobotoMono-Italic.ttfstyle: italic+ # White-label font configuration will be added here+ # BEGIN: WHITE_LABEL_FONT+ # END: WHITE_LABEL_FONT# To add assets to your application, add an assets section, like this:assets:@@ -298,6 +298,7 @@ flutter:- assets/images/login/- assets/translations/- assets/icons/icons.json+ - assets/fonts/# The following assets will be excluded in release.# BEGIN: EXCLUDE_IN_RELEASEdiff --git a/frontend/resources/flowy_icons/16x/flowy_ai_chat_logo.svg b/frontend/resources/flowy_icons/16x/ai_chat_logo.svgsimilarity index 100%rename from frontend/resources/flowy_icons/16x/flowy_ai_chat_logo.svgrename to frontend/resources/flowy_icons/16x/ai_chat_logo.svgdiff --git a/frontend/resources/flowy_icons/16x/flowy_logo.svg b/frontend/resources/flowy_icons/16x/app_logo.svgsimilarity index 100%rename from frontend/resources/flowy_icons/16x/flowy_logo.svgrename to frontend/resources/flowy_icons/16x/app_logo.svgdiff --git a/frontend/resources/flowy_icons/40x/flowy_logo.svg b/frontend/resources/flowy_icons/40x/app_logo.svgsimilarity index 100%rename from frontend/resources/flowy_icons/40x/flowy_logo.svgrename to frontend/resources/flowy_icons/40x/app_logo.svgdiff --git a/frontend/resources/flowy_icons/40x/flowy_logo_dark_mode.svg b/frontend/resources/flowy_icons/40x/app_logo_with_text_dark.svgsimilarity index 100%rename from frontend/resources/flowy_icons/40x/flowy_logo_dark_mode.svgrename to frontend/resources/flowy_icons/40x/app_logo_with_text_dark.svgdiff --git a/frontend/resources/flowy_icons/40x/flowy_logo_text.svg b/frontend/resources/flowy_icons/40x/app_logo_with_text_light.svgsimilarity index 100%rename from frontend/resources/flowy_icons/40x/flowy_logo_text.svgrename to frontend/resources/flowy_icons/40x/app_logo_with_text_light.svgdiff --git a/frontend/scripts/white_label/code_white_label.sh b/frontend/scripts/white_label/code_white_label.shnew file mode 100644index 0000000000..1123a394ee--- /dev/null+++ b/frontend/scripts/white_label/code_white_label.sh@@ -0,0 +1,72 @@+#!/bin/bash++show_usage() {+ echo "Usage: $0 [options]"+ echo "Options:"+ echo " --company-name Set the custom company name"+ echo " --help Show this help message"+ echo ""+ echo "Example:"+ echo " $0 --company-name \"MyCompany Ltd.\""+}++CUSTOM_COMPANY_NAME=""+CODE_FILE="appflowy_flutter/lib/workspace/application/notification/notification_service.dart"++while [[ $# -gt 0 ]]; do+ case $1 in+ --company-name)+ CUSTOM_COMPANY_NAME="$2"+ shift 2+ ;;+ --help)+ show_usage+ exit 0+ ;;+ *)+ echo "Unknown option: $1"+ show_usage+ exit 1+ ;;+ esac+done++if [ -z "$CUSTOM_COMPANY_NAME" ]; then+ echo "Error: Company name is required"+ show_usage+ exit 1+fi++if [ ! -f "$CODE_FILE" ]; then+ echo "Error: Code file not found at $CODE_FILE"+ exit 1+fi++echo "Replacing '_localNotifierAppName' value with '$CUSTOM_COMPANY_NAME' in code file..."++if sed --version >/dev/null 2>&1; then+ SED_INPLACE="-i"+else+ SED_INPLACE="-i ''"+fi++echo "Processing code file..."+if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then+ # First, escape any special characters in the company name+ ESCAPED_COMPANY_NAME=$(echo "$CUSTOM_COMPANY_NAME" | sed 's/[\/&]/\\&/g')+ # Replace the _localNotifierAppName value with the custom company name+ sed $SED_INPLACE "s/const _localNotifierAppName = 'AppFlowy'/const _localNotifierAppName = '$ESCAPED_COMPANY_NAME'/" "$CODE_FILE"+ if [ $? -ne 0 ]; then+ echo "Error: Failed to process $CODE_FILE with sed"+ exit 1+ fi+else+ # For Unix-like systems+ sed $SED_INPLACE "s/const _localNotifierAppName = 'AppFlowy'/const _localNotifierAppName = '$CUSTOM_COMPANY_NAME'/" "$CODE_FILE"+ if [ $? -ne 0 ]; then+ echo "Error: Failed to process $CODE_FILE with sed"+ exit 1+ fi+fi++echo "Replacement complete!"diff --git a/frontend/scripts/white_label/font_white_label.sh b/frontend/scripts/white_label/font_white_label.shnew file mode 100644index 0000000000..412ee6b062--- /dev/null+++ b/frontend/scripts/white_label/font_white_label.sh@@ -0,0 +1,198 @@+#!/bin/bash++show_usage() {+ echo "Usage: $0 [options]"+ echo "Options:"+ echo " --font-path Set the path to the folder containing font files (.ttf or .otf files)"+ echo " --font-family Set the name of the font family"+ echo " --help Show this help message"+ echo ""+ echo "Example:"+ echo " $0 --font-path \"/path/to/fonts\" --font-family \"CustomFont\""+}++FONT_PATH=""+FONT_FAMILY=""+TARGET_FONT_DIR="appflowy_flutter/assets/fonts/"+PUBSPEC_FILE="appflowy_flutter/pubspec.yaml"+BASE_APPEARANCE_FILE="appflowy_flutter/lib/workspace/application/settings/appearance/base_appearance.dart"++while [[ $# -gt 0 ]]; do+ case $1 in+ --font-path)+ FONT_PATH="$2"+ shift 2+ ;;+ --font-family)+ FONT_FAMILY="$2"+ shift 2+ ;;+ --help)+ show_usage+ exit 0+ ;;+ *)+ echo "Unknown option: $1"+ show_usage+ exit 1+ ;;+ esac+done++# Validate required arguments+if [ -z "$FONT_PATH" ]; then+ echo "Error: Font path is required"+ show_usage+ exit 1+fi++if [ -z "$FONT_FAMILY" ]; then+ echo "Error: Font family name is required"+ show_usage+ exit 1+fi++# Check if source directory exists+if [ ! -d "$FONT_PATH" ]; then+ echo "Error: Font directory not found at $FONT_PATH"+ exit 1+fi++# Create target directory if it doesn't exist+mkdir -p "$TARGET_FONT_DIR"++# Clean existing fonts in target directory+echo "Cleaning existing fonts in $TARGET_FONT_DIR..."+rm -rf "$TARGET_FONT_DIR"/*++# Copy font files to target directory+echo "Copying font files from $FONT_PATH to $TARGET_FONT_DIR..."+found_fonts=false+for ext in ttf otf; do+ if ls "$FONT_PATH"/*."$ext" >/dev/null 2>&1; then+ cp "$FONT_PATH"/*."$ext" "$TARGET_FONT_DIR"/ 2>/dev/null && found_fonts=true+ fi+done++if [ "$found_fonts" = false ]; then+ echo "Error: No font files (.ttf or .otf) found in source directory"+ exit 1+fi++# Generate font configuration for pubspec.yaml+echo "Generating font configuration..."++# Create temporary file for font configuration+TEMP_FILE=$(mktemp)++{+ echo " # BEGIN: WHITE_LABEL_FONT"+ echo " - family: $FONT_FAMILY"+ echo " fonts:"++ # Generate entries for each font file+ for font_file in "$TARGET_FONT_DIR"/*; do+ filename=$(basename "$font_file")+ echo " - asset: assets/fonts/$filename"++ # Try to detect font weight from filename+ if [[ $filename =~ (Thin|ExtraLight|Light|Regular|Medium|SemiBold|Bold|ExtraBold|Black) ]]; then+ case ${BASH_REMATCH[1]} in+ "Thin") echo " weight: 100";;+ "ExtraLight") echo " weight: 200";;+ "Light") echo " weight: 300";;+ "Regular") echo " weight: 400";;+ "Medium") echo " weight: 500";;+ "SemiBold") echo " weight: 600";;+ "Bold") echo " weight: 700";;+ "ExtraBold") echo " weight: 800";;+ "Black") echo " weight: 900";;+ esac+ fi++ # Try to detect italic style from filename+ if [[ $filename =~ Italic ]]; then+ echo " style: italic"+ fi+ done+ echo " # END: WHITE_LABEL_FONT"+} > "$TEMP_FILE"++# Update pubspec.yaml+echo "Updating pubspec.yaml..."+if [ -f "$PUBSPEC_FILE" ]; then+ # Create a backup of the original file+ cp "$PUBSPEC_FILE" "${PUBSPEC_FILE}.bak"++ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then+ # Windows-specific handling+ # First, remove existing white label font configuration+ awk '/# BEGIN: WHITE_LABEL_FONT/,/# END: WHITE_LABEL_FONT/{ next } /# White-label font configuration will be added here/{ print; system("cat '"$TEMP_FILE"'"); next } 1' "$PUBSPEC_FILE" > "${PUBSPEC_FILE}.tmp"++ if [ $? -eq 0 ]; then+ mv "${PUBSPEC_FILE}.tmp" "$PUBSPEC_FILE"+ rm -f "${PUBSPEC_FILE}.bak"+ else+ echo "Error: Failed to update pubspec.yaml"+ mv "${PUBSPEC_FILE}.bak" "$PUBSPEC_FILE"+ rm -f "${PUBSPEC_FILE}.tmp"+ rm -f "$TEMP_FILE"+ exit 1+ fi+ else+ # Unix-like systems handling+ if sed --version >/dev/null 2>&1; then+ SED_INPLACE="-i"+ else+ SED_INPLACE="-i ''"+ fi++ # Remove existing white label font configuration+ sed $SED_INPLACE '/# BEGIN: WHITE_LABEL_FONT/,/# END: WHITE_LABEL_FONT/d' "$PUBSPEC_FILE"++ # Add new font configuration+ sed $SED_INPLACE "/# White-label font configuration will be added here/r $TEMP_FILE" "$PUBSPEC_FILE"++ if [ $? -ne 0 ]; then+ echo "Error: Failed to update pubspec.yaml"+ mv "${PUBSPEC_FILE}.bak" "$PUBSPEC_FILE"+ rm -f "$TEMP_FILE"+ exit 1+ fi+ rm -f "${PUBSPEC_FILE}.bak"+ fi+else+ echo "Error: pubspec.yaml not found at $PUBSPEC_FILE"+ rm -f "$TEMP_FILE"+ exit 1+fi++# Update base_appearance.dart+echo "Updating base_appearance.dart..."+if [ -f "$BASE_APPEARANCE_FILE" ]; then+ # Create a backup of the original file+ cp "$BASE_APPEARANCE_FILE" "${BASE_APPEARANCE_FILE}.bak"++ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then+ # Windows-specific handling+ sed -i "s/const defaultFontFamily = '.*'/const defaultFontFamily = '$FONT_FAMILY'/" "$BASE_APPEARANCE_FILE"+ else+ # Unix-like systems handling+ sed -i '' "s/const defaultFontFamily = '.*'/const defaultFontFamily = '$FONT_FAMILY'/" "$BASE_APPEARANCE_FILE"+ fi++ if [ $? -ne 0 ]; then+ echo "Error: Failed to update base_appearance.dart"+ mv "${BASE_APPEARANCE_FILE}.bak" "$BASE_APPEARANCE_FILE"+ exit 1+ fi+ rm -f "${BASE_APPEARANCE_FILE}.bak"+else+ echo "Error: base_appearance.dart not found at $BASE_APPEARANCE_FILE"+ exit 1+fi++# Cleanup+rm -f "$TEMP_FILE"++echo "Font white labeling completed successfully!"diff --git a/frontend/scripts/white_label/icon_white_label.sh b/frontend/scripts/white_label/icon_white_label.shindex eb45d0f02f..ca70bc1661 100644--- a/frontend/scripts/white_label/icon_white_label.sh+++ b/frontend/scripts/white_label/icon_white_label.sh@@ -3,16 +3,16 @@show_usage() {echo "Usage: $0 [options]"echo "Options:"- echo " --icon-path Set the path to the application icon (.svg file)"+ echo " --icon-path Set the path to the folder containing application icons (.svg files)"echo " --help Show this help message"echo ""echo "Example:"- echo " $0 --icon-path \"/path/to/new/icon.svg\""+ echo " $0 --icon-path \"/path/to/icons_folder\""}NEW_ICON_PATH=""ICON_DIR="resources/flowy_icons"-ICON_NAME_NEED_REPLACE=("flowy_logo.svg" "flowy_ai_chat_logo.svg" "flowy_logo_dark_mode.svg" "flowy_logo_text.svg")+ICON_NAME_NEED_REPLACE=("app_logo.svg" "ai_chat_logo.svg" "app_logo_with_text_light.svg" "app_logo_with_text_dark.svg")while [[ $# -gt 0 ]]; docase $1 in@@ -38,12 +38,17 @@ if [ -z "$NEW_ICON_PATH" ]; thenexit 1fi+if [ ! -d "$NEW_ICON_PATH" ]; then+ echo "Error: New icon directory not found at $NEW_ICON_PATH"+ exit 1+fi+if [ ! -d "$ICON_DIR" ]; thenecho "Error: Icon directory not found at $ICON_DIR"exit 1fi-echo "Replacing icon..."+echo "Replacing icons..."echo "Processing icon files..."if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then@@ -52,13 +57,18 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; thenecho "Checking subdirectory: $(basename "$subdir")"for file in "${subdir}"*.svg; doif [ -f "$file" ] && [[ " ${ICON_NAME_NEED_REPLACE[@]} " =~ " $(basename "$file") " ]]; then- echo "Updating: $(basename "$subdir")/$(basename "$file")"- cp "$NEW_ICON_PATH" "$file"- if [ $? -eq 0 ]; then- echo "Successfully replaced $(basename "$file") in $(basename "$subdir") with new icon"+ new_icon="${NEW_ICON_PATH}/$(basename "$file")"+ if [ -f "$new_icon" ]; then+ echo "Updating: $(basename "$subdir")/$(basename "$file")"+ cp "$new_icon" "$file"+ if [ $? -eq 0 ]; then+ echo "Successfully replaced $(basename "$file") in $(basename "$subdir") with new icon"+ else+ echo "Error: Failed to replace $(basename "$file") in $(basename "$subdir")"+ exit 1+ fielse- echo "Error: Failed to replace $(basename "$file") in $(basename "$subdir")"- exit 1+ echo "Warning: New icon file $(basename "$file") not found in $NEW_ICON_PATH"fifidone@@ -67,15 +77,18 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; thenelsefor file in $(find "$ICON_DIR" -name "*.svg" -type f); doif [[ " ${ICON_NAME_NEED_REPLACE[@]} " =~ " $(basename "$file") " ]]; then- echo "Updating: $(basename "$file")"-- cp "$NEW_ICON_PATH" "$file"-- if [ $? -eq 0 ]; then- echo "Successfully replaced $(basename "$file") with new icon"+ new_icon="${NEW_ICON_PATH}/$(basename "$file")"+ if [ -f "$new_icon" ]; then+ echo "Updating: $(basename "$file")"+ cp "$new_icon" "$file"+ if [ $? -eq 0 ]; then+ echo "Successfully replaced $(basename "$file") with new icon"+ else+ echo "Error: Failed to replace $(basename "$file")"+ exit 1+ fielse- echo "Error: Failed to replace $(basename "$file")"- exit 1+ echo "Warning: New icon file $(basename "$file") not found in $NEW_ICON_PATH"fifidonediff --git a/frontend/scripts/white_label/white_label.sh b/frontend/scripts/white_label/white_label.shindex 2d6004cf9d..8ecd187210 100644--- a/frontend/scripts/white_label/white_label.sh+++ b/frontend/scripts/white_label/white_label.sh@@ -7,6 +7,8 @@ COMPANY_NAME="AppFlowy Inc."COPYRIGHT="Copyright © 2025 AppFlowy Inc."ICON_PATH=""WINDOWS_ICON_PATH=""+FONT_PATH=""+FONT_FAMILY=""PLATFORMS=("windows" "linux" "macos" "ios" "android")show_usage() {@@ -18,6 +20,8 @@ show_usage() {echo " --copyright Set the copyright information"echo " --icon-path Set the path to the application icon (.svg)"echo " --windows-icon-path Set the path to the windows application icon (.ico)"+ echo " --font-path Set the path to the folder containing font files (.ttf or .otf files)"+ echo " --font-family Set the name of the font family"echo " --platforms Comma-separated list of platforms to white label (windows,linux,macos,ios,android)"echo " --help Show this help message"echo ""@@ -26,7 +30,8 @@ show_usage() {echo " --company-name \"MyCompany Ltd.\" --copyright \"Copyright © 2025 MyCompany Ltd.\" \\"echo " --platforms \"windows,linux,macos\" \\"echo " --windows-icon-path \"./assets/icons/mycompany.ico\" \\"- echo " --icon-path \"./assets/icons/mycompany.svg\""+ echo " --icon-path \"./assets/icons/\" \\"+ echo " --font-path \"./assets/fonts/\" --font-family \"CustomFont\""}while [[ $# -gt 0 ]]; do@@ -55,6 +60,14 @@ while [[ $# -gt 0 ]]; doWINDOWS_ICON_PATH="$2"shift 2;;+ --font-path)+ FONT_PATH="$2"+ shift 2+ ;;+ --font-family)+ FONT_FAMILY="$2"+ shift 2+ ;;--platforms)IFS=',' read -ra PLATFORMS <<< "$2"shift 2@@ -77,8 +90,8 @@ if [ -z "$APP_NAME" ] || [ -z "$APP_IDENTIFIER" ] || [ -z "$COMPANY_NAME" ] || [exit 1fi-if [ ! -f "$ICON_PATH" ]; then- echo "Error: Icon file not found at $ICON_PATH"+if [ ! -d "$ICON_PATH" ]; then+ echo "Error: Icon directory not found at $ICON_PATH"exit 1fi@@ -111,6 +124,17 @@ bash "scripts/white_label/i18n_white_label.sh" --company-name "$COMPANY_NAME"echo -e "\033[32mRunning icon white label script...\033[0m"bash "scripts/white_label/icon_white_label.sh" --icon-path "$ICON_PATH"+echo -e "\033[32mRunning code white label script...\033[0m"+bash "scripts/white_label/code_white_label.sh" --company-name "$COMPANY_NAME"++# Run font white label script if font parameters are provided+if [ ! -z "$FONT_PATH" ] && [ ! -z "$FONT_FAMILY" ]; then+ echo -e "\033[32mRunning font white label script...\033[0m"+ bash "scripts/white_label/font_white_label.sh" \+ --font-path "$FONT_PATH" \+ --font-family "$FONT_FAMILY"+fi+for platform in "${PLATFORMS[@]}"; dorun_platform_script "$platform"done