Files
inji-wallet/tools/talisman/talisman-precommit.sh
PoojaBabusing d0f212600f talisman check for pre-commit and pre-push hooks (#915)
* feat(INJI-413): add talisman check for pre-commit and pre-push hooks

Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com>

* feat(INJI-413): add yarn jetify to package.json

Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com>

---------

Signed-off-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com>
Co-authored-by: Pooja Babusingh <68894211+PoojaBabusingh@users.noreply.github.com>
2023-10-13 15:56:24 +05:30

35 lines
937 B
Bash

#!/bin/bash
preCommitFile='.git/hooks/pre-commit'
prePushFile='.git/hooks/pre-push'
gitFolder='.git'
if [ ! -d $gitFolder ]
then
echo 'git not initialized'
else
if [ -f $preCommitFile ] && [ -z $GITHUB_ACTIONS ]
then
rm $preCommitFile
fi
if [ -f $prePushFile ] && [ -z $GITHUB_ACTIONS ]
then
rm $prePushFile
fi
if [ ! -f $preCommitFile ] && [ -z $GITHUB_ACTIONS ]
then
curl https://thoughtworks.github.io/talisman/install.sh > ~/install-talisman.sh
chmod +x ~/install-talisman.sh
~/install-talisman.sh pre-commit
echo 'pre-commit talisman hook installed'
fi
if [ ! -f $prePushFile ] && [ -z $GITHUB_ACTIONS ]
then
curl https://thoughtworks.github.io/talisman/install.sh > ~/install-talisman.sh
chmod +x ~/install-talisman.sh
~/install-talisman.sh pre-push
echo 'pre-push talisman hook installed'
fi
fi