diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-11-03 10:55:26 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-11-03 10:55:26 -0200 |
commit | b6dec4f1efe948f01df02b364cbb7f7aeedaa2b1 (patch) | |
tree | 0a51277f829b08b792204c8b4fe06c33bff4591a /lib/keyringer/actions/tree | |
parent | 374887922e7018e6b0c8e3d2ba8f52d4386ec682 (diff) | |
parent | 7fca7cd0433e6f97080ecf12bee64ec4f38948ba (diff) | |
download | keyringer-b6dec4f1efe948f01df02b364cbb7f7aeedaa2b1.tar.gz keyringer-b6dec4f1efe948f01df02b364cbb7f7aeedaa2b1.tar.bz2 |
Merge branch 'develop'
Diffstat (limited to 'lib/keyringer/actions/tree')
-rwxr-xr-x | lib/keyringer/actions/tree | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/keyringer/actions/tree b/lib/keyringer/actions/tree index 7bf173d..a877548 100755 --- a/lib/keyringer/actions/tree +++ b/lib/keyringer/actions/tree @@ -5,7 +5,7 @@ # Thanks http://www.centerkey.com/tree/ function keyringer_tree { - ls -R $* | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' + find $* | sed -e 's/[^-][^\/]*\//| /g' | sed -r -e 's/\| ([^|])/|- \1/' } # Load functions @@ -19,6 +19,11 @@ CWD="`pwd`" shift ARGS="`echo "$*" | sed -e "s|^/*||"`" +# on *BSD, find expects at least one argument with the path +if [ "$ARGS" == "" ]; then + ARGS="./" +fi + # Check implementation if which tree &> /dev/null; then TREE="tree" |