Skip to content

Commit

Permalink
add githooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jfoclpf committed Jun 13, 2024
1 parent 9380eb4 commit f2ba44c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .githooks/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -e

printf '\npost-checkout hook\n\n'

prevHEAD=$1
newHEAD=$2
checkoutType=$3

[[ $checkoutType == 1 ]] && checkoutType='branch' ||
checkoutType='file' ;

echo 'Checkout type: '$checkoutType
echo ' prev HEAD: '`git name-rev --name-only $prevHEAD`
echo ' new HEAD: '`git name-rev --name-only $newHEAD`

printf '\n'
echo 'Installing packages of package*.json of branch '`git name-rev --name-only $newHEAD`
printf '\n\n'

npm ci

0 comments on commit f2ba44c

Please sign in to comment.