@ -0,0 +1,16 @@ | |||||
#!/bin/bash | |||||
repoRoot=$(git rev-parse --show-toplevel) | |||||
listFilesToSubstitute=$(find -name *.gitsubstitute) | |||||
listStaticPathFiles=$(git grep -lr --untracked $repoRoot) | |||||
listStagedFiles=$(git diff --staged --name-only) | |||||
staticPathSubstitution="\${REPO_ROOT}" | |||||
for entryFileToSubstitute in $listFilesToSubstitute; do | |||||
fullPath="${repoRoot}/${entryFileToSubstitute}" | |||||
fullPathSubstitute="${repoRoot}/${entryFileToSubstitute%.gitsubstitute}" | |||||
fileContent=$(<$fullPath) | |||||
echo "${fileContent//${staticPathSubstitution}/${repoRoot}}" > "${fullPathSubstitute}" | |||||
done |
@ -0,0 +1,25 @@ | |||||
#!/bin/bash | |||||
repoRoot=$(git rev-parse --show-toplevel) | |||||
listStaticPathFiles=$(git grep -lr --untracked $repoRoot) | |||||
listStagedFiles=$(git diff --staged --name-only) | |||||
staticPathSubstitution="\${REPO_ROOT}" | |||||
for entryStagedFile in $listStagedFiles; do | |||||
for entryStaticPathFile in $listStaticPathFiles; do | |||||
if [ $entryStagedFile == $entryStaticPathFile ]; then | |||||
fullPath="${repoRoot}/${entryStagedFile}" | |||||
entryStagedFileSubstitute="${entryStagedFile}.gitsubstitute" | |||||
fullPathSubstitute="${repoRoot}/${entryStagedFileSubstitute}" | |||||
rm -f $fullPathSubstitute | |||||
fileContent=$(<$fullPath) | |||||
echo "${fileContent//${repoRoot}/${staticPathSubstitution}}" > "${fullPathSubstitute}" | |||||
git rm --cached $entryStagedFile | |||||
git add -f $entryStagedFileSubstitute | |||||
fi | |||||
done | |||||
done |
@ -0,0 +1,17 @@ | |||||
# ignore all workspace files | |||||
/.metadata/ | |||||
/RemoteSystemsTempFiles/ | |||||
.analytics | |||||
# ignore all log files | |||||
**/*.log | |||||
# ignore all files generated by pre-commit hook | |||||
**/*.gitsubstitute | |||||
# ignore all generated platform files but platform setup script | |||||
/hw_platform/* | |||||
!/hw_platform/platform.tcl | |||||
# ignore ide scripts | |||||
/*_system/_ide/scripts/* |