#!/usr/bin/bash -e # # pbrisbin 2013 (https://github.com/pbrisbin/scripts/blob/master/pacnews) # # Modified by Jesus Alvarez to use Neovim # if (( $UID )); then echo 'You must be root.' >&2 exit 1 fi shopt -s globstar nullglob set -- "${1:-/etc}"/**/*.pacnew (( $# )) || exit 1 for file; do current="${file/.pacnew/}" nvim -d "$current" "$file" rm -iv "$file" # -i gets us prompting for free [[ -f "$file" ]] && mv -iv "$file" "$current" done