Blackbox should work with Windows better WRT crlf.

This commit is contained in:
Tom Limoncelli
2017-06-16 08:16:07 -04:00
parent ddda729b7f
commit e1f03e4a74
2 changed files with 82 additions and 39 deletions

View File

@@ -35,6 +35,17 @@ vcs_add "${KEYRINGDIR}"
touch "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE"
vcs_add "$BLACKBOXDATA/$BB_ADMINS_FILE" "$BLACKBOXDATA/$BB_FILES_FILE"
if [[ $VCS_TYPE = "git" ]]; then
# Set .gitattributes so that Windows users don't break the admin files.
FILE="$BLACKBOXDATA/.gitattributes"
LINE='blackbox-admins.txt text eol=lf'
grep -qF "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
LINE='blackbox-files.txt text eol=lf'
grep -qF "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
fi
if [[ $VCS_TYPE = "svn" ]]; then
echo
echo