script.sh 557 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env sh
  2. set -eu
  3. ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
  4. EXAMPLE_DIR="$ROOT_DIR/apps/viewer-demo/public/example"
  5. count_files() {
  6. find "$EXAMPLE_DIR" -type f | wc -l | tr -d ' '
  7. }
  8. print_section() {
  9. printf '\n== %s ==\n' "$1"
  10. }
  11. print_section "Flyfish Viewer sample audit"
  12. printf 'root: %s\n' "$ROOT_DIR"
  13. printf 'examples: %s files\n' "$(count_files)"
  14. print_section "code samples"
  15. find "$EXAMPLE_DIR" \
  16. \( -name '*.js' -o -name '*.ts' -o -name '*.vue' -o -name '*.sql' \) \
  17. -maxdepth 1 \
  18. -type f \
  19. -print | sort