aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/upgrade-peertube.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/upgrade-peertube.sh')
-rwxr-xr-xscripts/upgrade-peertube.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/upgrade-peertube.sh b/scripts/upgrade-peertube.sh
index ff6dce94f..f7b856470 100755
--- a/scripts/upgrade-peertube.sh
+++ b/scripts/upgrade-peertube.sh
@@ -1,14 +1,21 @@
1#!/bin/bash 1#!/bin/bash
2 2
3nodeMinVersion="v6.0.0" 3verlte() {
4 [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
5}
6
7nodeMinVersion="6.0.0"
4npmMinVersion="3.0.0" 8npmMinVersion="3.0.0"
5 9
6if [[ $(node --version) < $nodeMinVersion ]]; then 10actualNodeVersion=$(node --version | tr -d "v")
11actualNpmVersion=$(npm --version)
12
13if verlte $actualNodeVersion $nodeMinVersion; then
7 echo 'You need node >= 6' 14 echo 'You need node >= 6'
8 exit 0 15 exit 0
9fi 16fi
10 17
11if [[ $(npm --version) < $npmMinVersion ]]; then 18if verlte $actualNpmVersion $npmMinVersion; then
12 echo 'You need npm >= 3' 19 echo 'You need npm >= 3'
13 exit 0 20 exit 0
14fi 21fi