1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#!/usr/bin/bash GitIgnoreDir=`git rev-parse --show-toplevel` GitIgnoreFile=$GitIgnoreDir"/.gitignore" CurrentDir=`pwd` for var in $@ do targetFileFullPath=$CurrentDir"/"$var targetFileRelativePath=`echo -e $targetFileFullPath | awk -F$GitIgnoreDir '{print $2}'` targetFileRelativePath=${targetFileRelativePath:1:10000} echo $targetFileRelativePath echo -e $targetFileRelativePath >> $GitIgnoreFile done |
Continue reading...