From df70a1ca99c74129aec246006f9cc374d43372c0 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Thu, 26 Aug 2021 18:12:39 -0500 Subject: [PATCH] Fix update with git tool when module dir is under an unresolved symlink. --- CHANGELOG.md | 11 +++++++---- src/tools/git.zsh.erb | 2 +- zimfw.zsh | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fcec7b..1024082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -_No unreleased changes._ +### Fixed +- Error in `zimfw update` with the `git` tool when module directory is under an + unresolved symlink. ## [1.5.0] - 2021-08-10 ### Added -- Option to use the new `degit` tool in `zmodule`, that is able to install and update modules - from GitHub without requiring `git`. Modules are installed faster and take less disk space when - using this tool. It can be set as the default with `zstyle ':zim:zmodule' use 'degit'`. +- Option to use the new `degit` tool in `zmodule`, that is able to install and + update modules from GitHub without requiring `git`. Modules are installed + faster and take less disk space when using this tool. It can be set as the + default with `zstyle ':zim:zmodule' use 'degit'`. ### Fixed - Force `core.autocrlf=false` when doing `git clone`. diff --git a/src/tools/git.zsh.erb b/src/tools/git.zsh.erb index 59c3fb8..3b2f9d8 100644 --- a/src/tools/git.zsh.erb +++ b/src/tools/git.zsh.erb @@ -25,7 +25,7 @@ case ${ACTION} in print_error "Error during cd ${DIR}" return 1 fi - if [[ ${PWD} != $(command git rev-parse --show-toplevel 2>/dev/null) ]]; then + if [[ ${PWD:A} != ${$(command git rev-parse --show-toplevel 2>/dev/null):A} ]]; then print_error "Module was not installed using git. Will not try to update. You can disable this with the zmodule option -z|--frozen." return 1 fi diff --git a/zimfw.zsh b/zimfw.zsh index b4b3856..f487e10 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -595,7 +595,7 @@ case \${ACTION} in print_error \"Error during cd \${DIR}\" return 1 fi - if [[ \${PWD} != \$(command git rev-parse --show-toplevel 2>/dev/null) ]]; then + if [[ \${PWD:A} != \${\$(command git rev-parse --show-toplevel 2>/dev/null):A} ]]; then print_error \"Module was not installed using git. Will not try to update. You can disable this with the zmodule option -z|--frozen.\" return 1 fi @@ -660,7 +660,7 @@ esac } zimfw() { - local -r _zversion='1.5.0' zusage="Usage: %B${0}%b [%B-q%b|%B-v%b] + local -r _zversion='1.5.1-SNAPSHOT' zusage="Usage: %B${0}%b [%B-q%b|%B-v%b] Actions: %Bbuild%b Build %Binit.zsh%b and %Blogin_init.zsh%b