From 75a1cea277ec99ee4a4bfaa3fd431d86b617ec6e Mon Sep 17 00:00:00 2001 From: gutmet Date: Wed, 24 Feb 2021 20:57:35 +0100 Subject: [PATCH] drop the .txt suffix for git dumps - serve only text/plain in nginx instead --- git-dump | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git-dump b/git-dump index f3a7e35..5a1f953 100755 --- a/git-dump +++ b/git-dump @@ -4,6 +4,9 @@ # Working directory needs to be git repo # call with name of directory you'd like to dump to +# if used with a web server, make sure to always server type text/plain +# or append .txt to fullpath + set -eu DIR="/var/www/git-dump/$1" @@ -16,7 +19,7 @@ echo "$files" | while IFS=$'\n' read -r f; do subdir=`dirname $f` fulldir="$DIR/$subdir" mkdir -p "$fulldir" - fullpath="$DIR/$f.txt" + fullpath="$DIR/$f" git show HEAD:"$f" > "$fullpath" if file "$fullpath" | grep -q "text"; then :