From 2d1d17616058126ef4c7e156f5925006839a822f Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Thu, 20 Jun 2019 19:10:47 +0530 Subject: Fix #288 --- plugins/getplugs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'plugins/getplugs') diff --git a/plugins/getplugs b/plugins/getplugs index b460d83..a8d8ec1 100755 --- a/plugins/getplugs +++ b/plugins/getplugs @@ -5,13 +5,16 @@ # Shell: POSIX compliant # Author: Arun Prakash Jana +CONFIG_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/ +PLUGIN_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins + # backup any earlier plugins -if [ -d ~/.config/nnn/plugins ]; then - tar -C ~/.config/nnn/ -cf ~/.config/nnn/"plugins-$(date '+%Y%m%d%H%M').tar.bz2" plugins/ +if [ -d $PLUGIN_DIR ]; then + tar -C $CONFIG_DIR -cf $CONFIG_DIR"plugins-$(date '+%Y%m%d%H%M').tar.bz2" plugins/ fi -mkdir -p ~/.config/nnn/plugins -cd ~/.config/nnn/plugins +mkdir -p $PLUGIN_DIR +cd $PLUGIN_DIR wget -nv --show-progress https://github.com/jarun/nnn/archive/master.tar.gz tar -xf master.tar.gz cp -vf nnn-master/plugins/* . -- cgit v1.2.3-70-g09d2