mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Fix: use case-insensitive find to get local templates
forgit::ignore::get should work on case-sensitive filesystems now
This commit is contained in:
parent
c1a8bd71dc
commit
cf4c45547c
|
|
@ -208,10 +208,16 @@ __forgit_ignore_update() {
|
|||
done) | sed 's/.gitignore$//' | sort -f -u >| "$FORGIT_GI_INDEX"
|
||||
}
|
||||
__forgit_ignore_get() {
|
||||
local item filename header
|
||||
for item in "$@"; do
|
||||
echo "### $item"
|
||||
cat "$FORGIT_GI_CACHE/gitignore/templates/${item}.gitignore"
|
||||
echo ""
|
||||
filename=$(find "$FORGIT_GI_CACHE/gitignore/templates" -type f -iname "${item}.gitignore" -print -quit)
|
||||
if [[ -n "$filename" ]]; then
|
||||
header="${filename##*/}" && header="${header%.gitignore}"
|
||||
echo "### $header"
|
||||
cat "$filename"
|
||||
echo ""
|
||||
filename=
|
||||
fi
|
||||
done
|
||||
}
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -202,10 +202,16 @@ forgit::ignore::update() {
|
|||
done) | sed 's/.gitignore$//' | sort -f -u >| "$FORGIT_GI_INDEX"
|
||||
}
|
||||
forgit::ignore::get() {
|
||||
local item filename header
|
||||
for item in "$@"; do
|
||||
echo "### $item"
|
||||
cat "$FORGIT_GI_CACHE/gitignore/templates/${item}.gitignore"
|
||||
echo ""
|
||||
filename=$(find "$FORGIT_GI_CACHE/gitignore/templates" -type f -iname "${item}.gitignore" -print -quit)
|
||||
if [[ -n "$filename" ]]; then
|
||||
header="${filename##*/}" && header="${header%.gitignore}"
|
||||
echo "### $header"
|
||||
cat "$filename"
|
||||
echo ""
|
||||
filename=
|
||||
fi
|
||||
done
|
||||
}
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue