[download]

local/bin/lexguy

   1 #!/bin/bash
   2 #         ▓███████
   3 #       ▓███████        Dotfiles: Lexguy
   4 #       ▓███████      > GNU Lesser General Public License
   5 #    ▓█████████████
   6 #       ▓███████      © 2020 Alexey Gagin <dev@lexa.by>
   7 #       ▓██  ▓██
   8 
   9 f=~/.cache/${0##*/}
  10 rm -f $f
  11 
  12 file=${1##*/}
  13 name=${PWD##*/}
  14 
  15 case ${file##*.} in
  16     svg) perm='Creative Commons BY-SA License';;
  17       *) perm='GNU Lesser General Public License';;
  18 esac
  19 
  20 case ${file##*.} in
  21      lua) comm='--';;
  22      css) comm=' *';;
  23     html) comm=' !';;
  24      xml) comm=' !';;
  25      svg) comm=' !';;
  26        c) comm='//';;
  27        h) comm='//';;
  28      php) comm='//';;
  29       js) comm='//';;
  30        *) comm='#';;
  31 esac
  32 
  33 # █▓▒░
  34 >> $f echo "     ▓███████"
  35 >> $f echo "   ▓███████        $name: $file"
  36 >> $f echo "   ▓███████      > $perm"
  37 >> $f echo "▓█████████████"; git log --date=format:%Y \
  38   --format="   ▓███████      © %cd %an <%ae>" "$1" | uniq >> $f
  39 >> $f echo "   ▓██  ▓██"
  40 
  41 sed "s:^:$(printf '%-2s' "$comm")   :" $f