aboutsummaryrefslogtreecommitdiff
path: root/lsd
blob: bddfafcfb8e2936fc55f677a9bc305f4435d53d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
#
# Lightweight Software Distribution (LSD) Management Script
#

# 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
    fi
    
    echo -n "`dirname $readme | sed -e 's/^.\///'`: "
    head -1 $readme
  done
  )
}

# Dispatch
if [ -z "$ACTION" ] || [ "$ACTION" == "list" ]; then
  lsd_list
fi