Rename 'npm run upgrade' to 'npm run upgrade-peertube'
authorChocobozzz <florian.bigard@gmail.com>
Sun, 25 Jun 2017 14:30:45 +0000 (16:30 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Sun, 25 Jun 2017 14:30:45 +0000 (16:30 +0200)
It was confusing with the command 'npm run update'

README.md
package.json
scripts/upgrade-peertube.sh [new file with mode: 0755]
scripts/upgrade.sh [deleted file]

index d7220b39f7e822425bd91d4637086d11fe0c68dd..c908d7bcb69213fab679db43aee5bce0969997d8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -178,7 +178,7 @@ You can check the application (CORS headers, tracker websocket...) by running:
 The following commands will upgrade the source (according to your current branch), upgrade node modules and rebuild client application:
 
     # systemctl stop peertube
-    $ npm run upgrade
+    $ npm run upgrade-peertube
     # systemctl start peertube
 
 ### Development
index f795dff9075e923d5cf7e93e79e812c440fdb393..93193fe2f3fe0077bd7e0203535515b95f9fe8cb 100644 (file)
@@ -34,7 +34,8 @@
     "dev:client": "scripty",
     "start": "node dist/server",
     "check": "ts-node ./scripts/check.ts",
-    "upgrade": "scripty",
+    "upgrade-peertube": "scripty",
+    "upgrade": "echo 'This command was renamed to upgrade-peertube.'",
     "update-host": "ts-node ./scripts/update-host.ts",
     "test": "scripty",
     "help": "scripty",
diff --git a/scripts/upgrade-peertube.sh b/scripts/upgrade-peertube.sh
new file mode 100755 (executable)
index 0000000..ff6dce9
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+nodeMinVersion="v6.0.0"
+npmMinVersion="3.0.0"
+
+if [[ $(node --version) < $nodeMinVersion ]]; then
+  echo 'You need node >= 6'
+  exit 0
+fi
+
+if [[ $(npm --version) < $npmMinVersion ]]; then
+  echo 'You need npm >= 3'
+  exit 0
+fi
+
+if ! which yarn > /dev/null; then
+  echo 'You need yarn'
+  exit 0
+fi
+
+if pgrep peertube > /dev/null; then
+  echo 'PeerTube is running!'
+  exit 0
+fi
+
+git pull origin $(git rev-parse --abbrev-ref HEAD) || exit -1
+
+yarn install --pure-lockfile
+npm run build
+
+echo "\n\nUpgrade finished! You can restart PeerTube that may run the migration scripts."
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh
deleted file mode 100755 (executable)
index ff6dce9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-nodeMinVersion="v6.0.0"
-npmMinVersion="3.0.0"
-
-if [[ $(node --version) < $nodeMinVersion ]]; then
-  echo 'You need node >= 6'
-  exit 0
-fi
-
-if [[ $(npm --version) < $npmMinVersion ]]; then
-  echo 'You need npm >= 3'
-  exit 0
-fi
-
-if ! which yarn > /dev/null; then
-  echo 'You need yarn'
-  exit 0
-fi
-
-if pgrep peertube > /dev/null; then
-  echo 'PeerTube is running!'
-  exit 0
-fi
-
-git pull origin $(git rev-parse --abbrev-ref HEAD) || exit -1
-
-yarn install --pure-lockfile
-npm run build
-
-echo "\n\nUpgrade finished! You can restart PeerTube that may run the migration scripts."