aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGravatar lvgx <l@vgx.fr>2020-05-06 19:06:19 +0200
committerGravatar GitHub <noreply@github.com>2020-05-06 22:36:19 +0530
commit11c9648774b408dc2e4b660f9389bed211d00215 (patch)
treef8df015570581fa20ee34b6c96854e0f86344339 /plugins
parent2a5f8433b8e1677119e7587a9fdd02b391f62b9d (diff)
downloadnnn-11c9648774b408dc2e4b660f9389bed211d00215.tar.gz
getplugs: add "master" version support (#560)
Pass "master" as first argument to the script.
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/getplugs12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/getplugs b/plugins/getplugs
index 0c68be0..d875074 100755
--- a/plugins/getplugs
+++ b/plugins/getplugs
@@ -43,8 +43,12 @@ prompt () {
# sucmd=: # noop
# fi
-if which nnn >/dev/null 2>&1; then
+if [ "$1" = "master" ] ; then
+ VER="master"
+ ARCHIVE_URL=https://github.com/jarun/nnn/archive/master.tar.gz
+elif which nnn >/dev/null 2>&1; then
VER=$(nnn -V)
+ ARCHIVE_URL=https://github.com/jarun/nnn/releases/download/v"$VER"/nnn-v"$VER".tar.gz
else
echo "nnn is not installed"
exit 1
@@ -57,8 +61,8 @@ fi
mkdir -p "$PLUGIN_DIR"
cd "$CONFIG_DIR" || exit 1
-curl -Ls -O https://github.com/jarun/nnn/releases/download/v"$VER"/nnn-v"$VER".tar.gz
-tar -zxf nnn-v"$VER".tar.gz
+curl -Ls "$ARCHIVE_URL" -o nnn-"$VER".tar.gz
+tar -zxf nnn-"$VER".tar.gz
cd nnn-"$VER"/plugins || exit 1
@@ -76,4 +80,4 @@ for f in $(find . -maxdepth 1 \( ! -iname "." ! -iname "*.md" \)); do
done
cd ../.. || exit 1
-rm -rf nnn-"$VER"/ nnn-v"$VER".tar.gz
+rm -rf nnn-"$VER"/ nnn-"$VER".tar.gz