-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcarddav2phone.sh
More file actions
executable file
·42 lines (34 loc) · 842 Bytes
/
carddav2phone.sh
File metadata and controls
executable file
·42 lines (34 loc) · 842 Bytes
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
#!/bin/bash
args=( "$@" )
# check if node is available
if which node > /dev/null; then
node="$(which node)"
else
echo "node not found. Please install a working version of node."
exit 1
fi
# check if npm is available
if which npm > /dev/null; then
npm="$(which npm)"
else
echo "npm not found. Please install a working version of npm."
npm=""
exit 1
fi
# check if git is available
if which git > /dev/null; then
git="$(which git)"
else
echo "Git not found. Please install a working version of git."
echo "Synology: \"Git Server\" (official), SynoCommunity's \"git\" or Entware-ng's."
git=""
fi
# change dir
cd "$(dirname "$0")" || exit 1
# self update and install dependencies
$git pull --force --rebase
$npm ci --omit dev --prefer-offline --no-audit --cache .npm
# run node app
$node dist/index.js "${args[@]}"
# exit
exit 0