From f6b623f515f0ae230e14abe54839ec9e30404fd5 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Mon, 9 Aug 2021 20:32:32 -0500 Subject: [PATCH] Do git clone with `core.autocrlf=false` to override any `core.autocrlf=true` the user could have set globally. Fixes #404 --- src/tools/degit.zsh.erb | 4 ++-- src/tools/git.zsh.erb | 2 +- zimfw.zsh | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/degit.zsh.erb b/src/tools/degit.zsh.erb index 3bdaf91..9585e23 100644 --- a/src/tools/degit.zsh.erb +++ b/src/tools/degit.zsh.erb @@ -7,7 +7,7 @@ print_error() { print -u2 -PR ${CLEAR_LINE}"%F{red}<%= error %>%B${MODULE}:%b ${1}%f"${2:+$'\n'${(F):- ${(f)^2}}} } -print_done() { +print_okay() { if [[ -e ${DIR}/.gitmodules ]]; then local -r warn=${CLEAR_LINE}"%F{yellow}<%= warn %>%B${MODULE}:%b ${(C)1}. Module contains git submodules, which are not supported by Zim's degit and were not ${1}.%f" if (( PRINTLEVEL > 0 )); then @@ -134,7 +134,7 @@ create_dir() { print_error "Error updating ${DIR}" ${ERR} return 1 fi - print_done updated ${LOG} + print_okay updated ${LOG} } always { command rm -f ${TARBALL_TARGET} 2>/dev/null command rm -rf ${dir_new} 2>/dev/null diff --git a/src/tools/git.zsh.erb b/src/tools/git.zsh.erb index e86f027..59c3fb8 100644 --- a/src/tools/git.zsh.erb +++ b/src/tools/git.zsh.erb @@ -13,7 +13,7 @@ print_okay() { case ${ACTION} in install) - if ERR=$(command git clone ${REV:+-b} ${REV} -q --recursive ${URL} ${DIR} 2>&1); then + if ERR=$(command git clone ${REV:+-b} ${REV} -q --config core.autocrlf=false --recursive ${URL} ${DIR} 2>&1); then print_okay Installed else print_error 'Error during git clone' ${ERR} diff --git a/zimfw.zsh b/zimfw.zsh index 4c1d56a..e765de3 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -334,7 +334,7 @@ _zimfw_compile() { } _zimfw_info() { - print -R 'zimfw version: '${_zversion}' (built at 2021-07-11 20:55:58 UTC, previous commit is 2c8f8e3)' + print -R 'zimfw version: '${_zversion}' (built at 2021-08-10 01:21:11 UTC, previous commit is 6700933)' print -R 'ZIM_HOME: '${ZIM_HOME} print -R 'Zsh version: '${ZSH_VERSION} print -R 'System info: '$(command uname -a) @@ -427,7 +427,7 @@ print_error() { print -u2 -PR \${CLEAR_LINE}\"%F{red}x %B\${MODULE}:%b \${1}%f\"\${2:+$'\n'\${(F):- \${(f)^2}}} } -print_done() { +print_okay() { if [[ -e \${DIR}/.gitmodules ]]; then local -r warn=\${CLEAR_LINE}\"%F{yellow}! %B\${MODULE}:%b \${(C)1}. Module contains git submodules, which are not supported by Zim's degit and were not \${1}.%f\" if (( PRINTLEVEL > 0 )); then @@ -554,7 +554,7 @@ create_dir() { print_error \"Error updating \${DIR}\" \${ERR} return 1 fi - print_done updated \${LOG} + print_okay updated \${LOG} } always { command rm -f \${TARBALL_TARGET} 2>/dev/null command rm -rf \${dir_new} 2>/dev/null @@ -578,7 +578,7 @@ print_okay() { case \${ACTION} in install) - if ERR=\$(command git clone \${REV:+-b} \${REV} -q --recursive \${URL} \${DIR} 2>&1); then + if ERR=\$(command git clone \${REV:+-b} \${REV} -q --config core.autocrlf=false --recursive \${URL} \${DIR} 2>&1); then print_okay Installed else print_error 'Error during git clone' \${ERR}