File: pre-commit

package info (click to toggle)
aasvg 0.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 196 kB
  • sloc: javascript: 1,197; makefile: 20; sh: 16
file content (14 lines) | stat: -rwxr-xr-x 327 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
if [ "$1" = "install" ]; then
  if hash realpath; then
    source="$(realpath "$0")"
  else
    p="$(cd "$(dirname "$0")"; pwd)"
    f="$(basename "$0")"
    source="$p/$f"
  fi
  target="$(git rev-parse --git-dir 2>/dev/null)"/hooks/pre-commit
  [ -f "$target" ] || ln -s "$source" "$target"
  exit
fi
exec npm test