mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-06 20:23:52 -05:00
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>
This commit is contained in:
@@ -2,3 +2,4 @@
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
||||
.git/hooks/bin/talisman ${DEBUG_OPTS} --githook pre-commit
|
||||
0
.talismanrc
Normal file
0
.talismanrc
Normal file
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"scripts": {
|
||||
"prepare": "husky install",
|
||||
"jetify": "jetify",
|
||||
"start": "react-native start",
|
||||
"android:mosip": "react-native run-android --variant=mosipDebug",
|
||||
"ios": "react-native run-ios",
|
||||
@@ -8,7 +9,7 @@
|
||||
"i18n:compile-strings": "node scripts/compile-strings.js",
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
|
||||
"test": "jest",
|
||||
"postinstall": "patch-package"
|
||||
"postinstall": "patch-package && npm run jetify && sh tools/talisman/talisman-precommit.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"@digitalbazaar/ed25519-signature-2018": "digitalbazaar/ed25519-signature-2018",
|
||||
|
||||
35
tools/talisman/talisman-precommit.sh
Normal file
35
tools/talisman/talisman-precommit.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user