瀏覽代碼

Add user script to upgrade nnn on Debian 9 Stretch

master
Arun Prakash Jana 6 年之前
父節點
當前提交
51acd70ba0
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A75979F35C080412
共有 1 個檔案被更改,包括 24 行新增0 行删除
  1. +24
    -0
      scripts/user-scripts/upgrade.sh

+ 24
- 0
scripts/user-scripts/upgrade.sh 查看文件

@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# Description: Check and update to latest version of nnn manually on Debian 9 Stretch
#
# Shell: bash
# Author: Arun Prakash Jana
# NOTE: This script installs a package, should be issued with admin privilege

cur=`nnn -v`
new=`curl -s "https://github.com/jarun/nnn/releases/latest" | grep -Eo "[0-9]+\.[0-9]+"`

if [ $cur_ver == $new_ver ]; then
echo 'Already at latest version'
exit 0
fi

# get the package
wget "https://github.com/jarun/nnn/releases/download/v$new/nnn_$new-1_debian9.amd64.deb"

# install it
dpkg -i nnn_$new-1_debian9.amd64.deb

# remove the file
rm -rf nnn_$new-1_debian9.amd64.deb

Loading…
取消
儲存