aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-12-10 18:48:53 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-12-10 18:48:53 -0200
commitd3c34db2f307d86209235832db8b9c04a2942405 (patch)
tree5baa319091bc739d9bd4643e95d87d063c79d136
parent2409a2c5bcdfd43c61072545e23148e9e9c6ca67 (diff)
downloadkeyringer-d3c34db2f307d86209235832db8b9c04a2942405.tar.gz
keyringer-d3c34db2f307d86209235832db8b9c04a2942405.tar.bz2
Adding mkdir action (#34)
-rwxr-xr-xlib/keyringer/actions/mkdir19
-rw-r--r--share/man/keyringer.1.mdwn3
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/keyringer/actions/mkdir b/lib/keyringer/actions/mkdir
new file mode 100755
index 0000000..b31eb0b
--- /dev/null
+++ b/lib/keyringer/actions/mkdir
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Create folders.
+#
+
+# Load functions
+LIB="`dirname $0`/../functions"
+source "$LIB" || exit 1
+
+# Aditional parameters
+CWD="`pwd`"
+
+# Avoid leading slash
+shift
+ARGS="`echo "$*" | sed -e "s|^/*||"`"
+
+# Run mkdir command
+cd "$KEYDIR/$RELATIVE_PATH" && mkdir -p $ARGS
+cd "$CWD"
diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn
index b383507..f8d243e 100644
--- a/share/man/keyringer.1.mdwn
+++ b/share/man/keyringer.1.mdwn
@@ -56,6 +56,9 @@ ls <*path*>
if *path* is specified. Like the git wrapper, this is a wrapper around the *LS(1)*
command.
+mkdir <*path*>
+: Create a directory inside the repository *keys* folder.
+
tree <*path*>
: List contents from the toplevel repository *keys* folder or from relative paths
if *path* is specified using a tree-like format. Like the ls wrapper, this is a