My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

35 lignes
816 B

  1. #!/usr/bin/env sh
  2. # Description: Update nnn plugins
  3. #
  4. # Shell: POSIX compliant
  5. # Author: Arun Prakash Jana
  6. CONFIG_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
  7. PLUGIN_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins
  8. is_cmd_exists () {
  9. which "$1" > /dev/null 2>&1
  10. echo $?
  11. }
  12. if [ "$(is_cmd_exists sudo)" -eq "0" ]; then
  13. sucmd=sudo
  14. elif [ "$(is_cmd_exists doas)" -eq "0" ]; then
  15. sucmd=doas
  16. else
  17. sucmd=: # noop
  18. fi
  19. # backup any earlier plugins
  20. if [ -d $PLUGIN_DIR ]; then
  21. tar -C $CONFIG_DIR -czf $CONFIG_DIR"plugins-$(date '+%Y%m%d%H%M').tar.gz" plugins/
  22. fi
  23. cd $CONFIG_DIR
  24. curl -Ls -O https://github.com/jarun/nnn/archive/master.tar.gz
  25. tar -zxf master.tar.gz
  26. cp -vRf nnn-master/plugins .
  27. $sucmd mv -vf nnn-master/misc/nlaunch/nlaunch /usr/local/bin/
  28. rm -rf nnn-master/ master.tar.gz README.md