diff options
author | Jesus Alvarez | 2017-08-14 11:15:18 -0700 |
---|---|---|
committer | Jesus Alvarez | 2017-08-14 11:15:18 -0700 |
commit | b369eda3095bbf7fce6c672cf8ed77283e1fd77c (patch) | |
tree | 0c8b03bdaea952cb0f6d8414de85773aeb9d8452 /pacnews | |
download | aur-b369eda3095bbf7fce6c672cf8ed77283e1fd77c.tar.gz |
Initial commit
Diffstat (limited to 'pacnews')
-rwxr-xr-x | pacnews | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pacnews b/pacnews new file mode 100755 index 000000000000..179f95b0eced --- /dev/null +++ b/pacnews @@ -0,0 +1,27 @@ +#!/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/}" + + neovim -d "$current" "$file" + + rm -iv "$file" # -i gets us prompting for free + [[ -f "$file" ]] && mv -iv "$file" "$current" +done |