commit 0c2b9fb6418f8f1e8281f77219d6f78c759b9a0a
parent 8502d021b4461c9d4cbb53ca8ad49595727cbfdf
Author: Cem Keylan <cem@ckyln.com>
Date: Tue, 10 Mar 2020 09:57:12 +0300
pm-contrib: new scripts
Diffstat:
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/pm/contrib/Makefile b/pm/contrib/Makefile
@@ -1,6 +1,6 @@
PREFIX = /usr/local
BINDIR = ${PREFIX}/bin
-contrib = pm-add-dmenu pm-ask pm-copy pm-copy-dmenu
+contrib = pm-add-dmenu pm-ask pm-copy pm-copy-dmenu pm-git pm-tree
install:
install -Dm755 -t ${DESTDIR}${BINDIR} ${contrib}
diff --git a/pm/contrib/pm-git b/pm/contrib/pm-git
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd "${PM_DIR:-$HOME/.local/share/pm}" || exit 1
+git "$@"
diff --git a/pm/contrib/pm-tree b/pm/contrib/pm-tree
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+printf '%s\n' "pm store"
+tree -C -l --noreport "${PM_DIR:-$HOME/.local/share/pm}" | tail -n +2 | sed -E 's/\.asc(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
+