-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustomize
More file actions
57 lines (55 loc) · 2.62 KB
/
customize
File metadata and controls
57 lines (55 loc) · 2.62 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
DIR="shma-server"
if [ -d "$DIR" ]; then
cd $DIR
git pull
cd ..
else
git clone --branch master https://github.com/we-kode/shma-server.git
fi
# replace icons
echo "Replacing icons"
cp -a "./config/icons/assets/." "$DIR/assets/images/"
cp -a "./config/icons/windows/." "$DIR/windows/runner/resources"
#cp -a "./config/icons/macos/." "$DIR/macos/Runner/Assets.xcassets/AppIcon.appiconset"
#cp -a "./config/debian/." "$DIR/debian"
# replace color schema
COLOR_SCHEME=./config/lib_color_schemes.g.dart
if test -f "$COLOR_SCHEME"; then
echo "Replacing color scheme"
cp "$COLOR_SCHEME" "$DIR/lib/lib_color_schemes.g.dart"
fi
# replace titles
echo "Replacing titles"
input="./config/app.cfg"
while IFS='=' read -r key value
do
case $key in
appTitle_en)
sed -i -E "s/\"appTitle\": .*/\"appTitle\": \"$value\",/" "$DIR/lib/l10n/shma_server_en.arb"
;;
appTitle_ru)
sed -i -E "s/\"appTitle\": .*/\"appTitle\": \"$value\",/" "$DIR/lib/l10n/shma_server_ru.arb"
;;
appTitle_de)
sed -i -E "s/\"appTitle\": .*/\"appTitle\": \"$value\",/" "$DIR/lib/l10n/shma_server_de.arb"
;;
appTitle)
sed -i -E "s/ if \(!window.CreateAndShow\(L\".*\", origin, size\)\) \{/ if \(!window.CreateAndShow\(L\"$value\", origin, size\)\) \{/" "$DIR/windows/runner/main.cpp"
sed -i -E "s/ gtk_header_bar_set_title\(header_bar, \".*\"\);/ gtk_header_bar_set_title\(header_bar, \"$value\"\);/" "$DIR/linux/my_application.cc"
sed -i -E "s/ gtk_window_set_title\(window, \".*\"\);/ gtk_window_set_title\(window, \"$value\"\);/" "$DIR/linux/my_application.cc"
sed -i -E "s/PRODUCT_NAME = .*/PRODUCT_NAME = $value/" "$DIR/macos/Runner/Configs/AppInfo.xcconfig"
sed -i -E "s/ display_name: .*/ display_name: $value/" "$DIR/pubspec.yaml"
;;
appId)
sed -i -E "s/PRODUCT_BUNDLE_IDENTIFIER = .*/PRODUCT_BUNDLE_IDENTIFIER = $value/" "$DIR/macos/Runner/Configs/AppInfo.xcconfig"
sed -i -E "s/set\(APPLICATION_ID \".*\"\)/set\(APPLICATION_ID \"$value\"\)/" "$DIR/linux/CMakeLists.txt"
sed -i -E "s/ <string>\$(AppIdentifierPrefix)de.wekode.shma_server<\/string>/ <string>\$(AppIdentifierPrefix)$value<\/string>/" "$DIR/macos/Runner/DebugProfile.entitlements"
sed -i -E "s/ <string>\$(AppIdentifierPrefix)de.wekode.shma_server<\/string>/ <string>\$(AppIdentifierPrefix)$value<\/string>/" "$DIR/macos/Runner/Release.entitlements"
sed -i -E "s/ <string>\$(AppIdentifierPrefix)de.wekode.shma_server<\/string>/ <string>\$(AppIdentifierPrefix)$value<\/string>/" "$DIR/macos/Runner/RunnerDebug.entitlements"
sed -i -E "s/ identity_name: .*/ identity_name: $value/" "$DIR/pubspec.yaml"
;;
*)
echo "Not known key: $key"
esac
done < "$input"