aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-07-10 15:01:05 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-07-10 15:01:05 +0200
commit7a214f746bf420defbf17fa218d90d6233551bf8 (patch)
tree3793dc0ae572d4bbde160d9c8949e9e27b92f709
parentad0997adfb9e1e3b1ff54338d7558cf7b18440ea (diff)
downloadPeerTube-7a214f746bf420defbf17fa218d90d6233551bf8.tar.gz
PeerTube-7a214f746bf420defbf17fa218d90d6233551bf8.tar.zst
PeerTube-7a214f746bf420defbf17fa218d90d6233551bf8.zip
Fix upgrade peertube script (bad semver comparison)
-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