-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·105 lines (85 loc) · 1.96 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·105 lines (85 loc) · 1.96 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
##########################################################################
# A script to run the desktop app in development mode
#
# On Windows, ensure that you have first set Git bash as the node.js shell
# - npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
##########################################################################
cd "$(dirname "${BASH_SOURCE[0]}")"
#
# Get the platform
#
case "$(uname -s)" in
Darwin)
PLATFORM="MACOS"
;;
MINGW64*)
PLATFORM="WINDOWS"
;;
Linux)
PLATFORM="LINUX"
;;
esac
#
# Download dependencies
#
npm install
if [ $? -ne 0 ]; then
echo 'Problem encountered downloading dependencies'
exit
fi
#
# Make code quality checks
#
npm run lint
if [ $? -ne 0 ]; then
echo 'Code quality checks failed'
exit 1
fi
#
# Prepare the dist folder
#
rm -rf dist 2>/dev/null
mkdir dist
#
# Build the code in watch mode, and run a live reload server
#
echo 'Building application bundles ...'
if [ "$PLATFORM" == 'MACOS' ]; then
open -a Terminal ./buildDebug.sh
elif [ "$PLATFORM" == 'WINDOWS' ]; then
GIT_BASH="C:\Program Files\Git\git-bash.exe"
"$GIT_BASH" -c ./buildDebug.sh &
elif [ "$PLATFORM" == 'LINUX' ]; then
gnome-terminal -- ./buildDebug.sh
fi
#
# Wait for built bundles to become available
#
while [ ! -f ./dist/app.bundle.js ]; do
sleep 1
done
#
# Post build behaviors for Linux desktop applications
#
if [ "$PLATFORM" == 'LINUX' ]; then
#
# Register the application's private URI scheme with the operating system
#
ELECTRON_EXE_PATH="$(pwd)/node_modules/electron/dist/electron"
export APP_COMMAND="$ELECTRON_EXE_PATH $(pwd)/dist"
./linux/register.sh
#
# Enter a password to work around this Electron issue:
# - https://github.com/electron/electron/issues/42510
#
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
#
# Run the Electron app
#
npx electron ./dist
if [ $? -ne 0 ]; then
echo 'Problem encountered running the desktop app'
exit
fi