diff options
| author | Marc Vertes <mvertes@free.fr> | 2021-06-19 15:59:06 +0200 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2021-06-19 15:59:06 +0200 |
| commit | 6f40c5ba8549a66bd2b9ab449f57a574f0c2e905 (patch) | |
| tree | b11017342b911cbce593e0cde989140e7379bb91 /bin | |
| parent | 53569210e7967c6d891affb027c1ea202194f9c0 (diff) | |
vimki: fix rename
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/vimki | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -24,6 +24,8 @@ rename1() { ' "$3" } +#shellcheck disable=SC2020 + linkfile() { echo "$1" | tr '[:upper:]' '[:lower:]' | @@ -36,8 +38,8 @@ rename() { [ "$(head -c 8 "$f")" = VimCrypt ] && continue rename1 "$1" "$2" "$f" > "$f.$$" && mv "$f.$$" "$f" done - oldf="$(linkfile "$1")" - [ -f "$oldf" ] && mv "$oldf" "$(linkfile "$2")" + oldf="$(linkfile "$1").md" + [ -f "$oldf" ] && mv "$oldf" "$(linkfile "$2").md" } fixfiles() { @@ -46,5 +48,5 @@ fixfiles() { done } -cd ~/Wiki +cd ~/Wiki || exit "$@" |
