summarylogtreecommitdiffstats
path: root/pacnews
diff options
context:
space:
mode:
authorJesus Alvarez2017-08-14 11:15:18 -0700
committerJesus Alvarez2017-08-14 11:15:18 -0700
commitb369eda3095bbf7fce6c672cf8ed77283e1fd77c (patch)
tree0c8b03bdaea952cb0f6d8414de85773aeb9d8452 /pacnews
downloadaur-b369eda3095bbf7fce6c672cf8ed77283e1fd77c.tar.gz
Initial commit
Diffstat (limited to 'pacnews')
-rwxr-xr-xpacnews27
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