fix(finit): don't alter user .gitignore during migration, no need

pull/18/head
kevin zhuang 4 years ago
parent c983e916fe
commit 6b512699e0

@ -71,14 +71,6 @@ if [[ -z "${remote_url}" ]]; then
else
[[ ! -d "${DOTBARE_TREE}" ]] && mkdir -p "${DOTBARE_TREE}"
cd "${DOTBARE_TREE}"
if [[ -f ".gitignore" ]]; then
pattern=$(basename "${DOTBARE_DIR}")
pattern="^${pattern}$"
exists=$(awk -v pattern="${pattern}" '{ if ($0 ~ pattern) { print $0; } }' .gitignore)
[[ -z "${exists}" ]] && basename "${DOTBARE_DIR}" >> .gitignore
else
basename "${DOTBARE_DIR}" >> .gitignore
fi
git clone --bare "${remote_url}" "${DOTBARE_DIR}"
if ! /usr/bin/git --git-dir "${DOTBARE_DIR}" --work-tree "${DOTBARE_TREE}" checkout 2> /dev/null; then
echo "File checkout failed"

Loading…
Cancel
Save