]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/bash | |
2 | ||
3 | nodeMinVersion="v6.0.0" | |
4 | npmMinVersion="3.0.0" | |
5 | ||
6 | if [[ $(node --version) < $nodeMinVersion ]]; then | |
7 | echo 'You need node >= 6' | |
8 | exit 0 | |
9 | fi | |
10 | ||
11 | if [[ $(npm --version) < $npmMinVersion ]]; then | |
12 | echo 'You need npm >= 3' | |
13 | exit 0 | |
14 | fi | |
15 | ||
16 | if ! which yarn > /dev/null; then | |
17 | echo 'You need yarn' | |
18 | exit 0 | |
19 | fi | |
20 | ||
21 | if pgrep peertube > /dev/null; then | |
22 | echo 'PeerTube is running!' | |
23 | exit 0 | |
24 | fi | |
25 | ||
26 | git pull origin $(git rev-parse --abbrev-ref HEAD) || exit -1 | |
27 | ||
28 | yarn install | |
29 | yarn upgrade | |
30 | cd client && yarn upgrade && cd ../ | |
31 | npm run build | |
32 | ||
33 | echo "\n\nUpgrade finished! You can restart PeerTube that may run the migration scripts." |