]> gitweb.fluxo.info Git - rhatto/apps.git/commitdiff
LSD: restrict listing to the repo
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 27 May 2018 21:01:01 +0000 (18:01 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 27 May 2018 21:01:01 +0000 (18:01 -0300)
lsd

diff --git a/lsd b/lsd
index 668fca34de4cdf313815a9023911f893cb0b67da..bddfafcfb8e2936fc55f677a9bc305f4435d53d5 100755 (executable)
--- a/lsd
+++ b/lsd
@@ -4,12 +4,15 @@
 #
 
 # Parameters
+DIRNAME="`dirname $0`"
 BASENAME="`basename $0`"
 ACTION="$1"
 
 # List apps
 function lsd_list {
   #find -maxdepth 2 -iname 'readme*' -exec head -1 {} \; 
+  (
+  cd $DIRNAME
   find -maxdepth 2 -iname 'readme*' | while read readme; do
     if [ "$readme" == "./README.md" ]; then
       continue
@@ -18,6 +21,7 @@ function lsd_list {
     echo -n "`dirname $readme | sed -e 's/^.\///'`: "
     head -1 $readme
   done
+  )
 }
 
 # Dispatch