forked from ONLYOFFICE/server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-mac.command
executable file
·83 lines (61 loc) · 2.87 KB
/
run-mac.command
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
echo "----------------------------------------"
echo "Copy file to converter"
echo "----------------------------------------"
BASEDIR="$(cd "$(dirname "$0")" && pwd)"
echo "$BASEDIR"
CreateDir() {
if [ ! -d $1 ]; then
mkdir -pv $1;
fi
}
NpmInstall() {
cd $1
echo "Module path: $(pwd)"
npm install
}
RunCommand() {
osascript -e 'tell application "terminal"' -e "do script \"$1\"" -e 'end tell'
}
CreateDir "$BASEDIR/App_Data"
CreateDir "$BASEDIR/FileConverter/bin"
CreateDir "$BASEDIR/FileConverter/bin/HtmlFileInternal"
cd "$BASEDIR/FileConverter/bin"
cp -v "../../../core/build/bin/mac/icudtl_dat.S" "."
cp -v "../../../core/build/bin/mac/x2t" "."
cp -v "../../../core/build/bin/icu/mac_64/libicudata.55.1.dylib" "."
cp -v "../../../core/build/bin/icu/mac_64/libicuuc.55.1.dylib" "."
cp -v "../../../core/build/lib/mac_64/libDjVuFile.dylib" "."
cp -v "../../../core/build/lib/mac_64/libHtmlFile.dylib" "."
cp -v "../../../core/build/lib/mac_64/libHtmlRenderer.dylib" "."
cp -v "../../../core/build/lib/mac_64/libPdfReader.dylib" "."
cp -v "../../../core/build/lib/mac_64/libPdfWriter.dylib" "."
cp -v "../../../core/build/lib/mac_64/libUnicodeConverter.dylib" "."
cp -v "../../../core/build/lib/mac_64/libXpsFile.dylib" "."
cp -v "../../../core/build/lib/mac_64/libascdocumentscore.dylib" "."
cp -v "../../../core/build/lib/mac_64/libdoctrenderer.dylib" "."
ln -sifv libicuuc.55.1.dylib libicuuc.55.dylib
ln -sifv libicudata.55.1.dylib libicudata.55.dylib
chmod -v +x x2t
SEARCH='..\/..\/OfficeWeb'
REPLACE='..\/..\/..\/sdkjs'
sed "s/$SEARCH/$REPLACE/g" "../../../core/build/lib/DoctRenderer.config" > "DoctRenderer.config"
echo $BASEDIR
chmod -v +x $BASEDIR/../core/build/bin/AllFontsGen/mac_64
bash -cv "$BASEDIR/../core/build/bin/AllFontsGen/mac_64 '' '$BASEDIR/../sdkjs/Common/AllFonts.js' '$BASEDIR/../sdkjs/Common/Images' '$BASEDIR/FileConverter/bin/font_selection.bin'"
echo "----------------------------------------"
echo "Install node.js modules "
echo "----------------------------------------"
NpmInstall "$BASEDIR/DocService"
NpmInstall "$BASEDIR/Common"
NpmInstall "$BASEDIR/FileConverter"
NpmInstall "$BASEDIR/SpellChecker"
echo "----------------------------------------"
echo "Run services"
echo "----------------------------------------"
mysql.server restart
RunCommand "/usr/local/sbin/rabbitmq-server"
RunCommand "redis-server /usr/local/etc/redis.conf"
RunCommand "export NODE_CONFIG_DIR=$BASEDIR/Common/config && export NODE_ENV=development-mac && cd $BASEDIR/DocService/sources && node server.js"
RunCommand "export NODE_CONFIG_DIR=$BASEDIR/Common/config && export NODE_ENV=development-mac && cd $BASEDIR/DocService/sources && node gc.js"
RunCommand "export NODE_CONFIG_DIR=$BASEDIR/Common/config && export NODE_ENV=development-mac && export DYLD_LIBRARY_PATH=../../FileConverter/bin/ && cd $BASEDIR/FileConverter/sources && node convertermaster.js"