diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-02-03 13:46:02 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-02-03 13:46:02 +0100 |
commit | e593c4e2c36ba7ac3be7180fada09535ea745b05 (patch) | |
tree | 672fa8a693681fe4b4471d03fd9fd798bd5e303f | |
parent | fix(modules/lf/commands/archive_decompress): Pipe the filenames not the file (diff) | |
download | nixos-config-e593c4e2c36ba7ac3be7180fada09535ea745b05.zip |
fix(modules/lf/commands/archive_{compress,decompress}): Correctly store paths
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/archive_compress.sh | 10 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/archive_decompress.sh | 2 |
2 files changed, 2 insertions, 10 deletions
diff --git a/modules/by-name/lf/lf/commands/scripts/archive_compress.sh b/modules/by-name/lf/lf/commands/scripts/archive_compress.sh index 0d53af2a..c3776a80 100755 --- a/modules/by-name/lf/lf/commands/scripts/archive_compress.sh +++ b/modules/by-name/lf/lf/commands/scripts/archive_compress.sh @@ -1,11 +1,5 @@ # shellcheck shell=sh -# Option '-f' disables pathname expansion which can be useful when $f, $fs, and -# $fx variables contain names with '*' or '?' characters. However, this option -# is used selectively within individual commands as it can be limiting at -# times. -set -f - # shellcheck disable=SC2269 f="$f" # shellcheck disable=SC2269 @@ -49,7 +43,7 @@ done # fx contains all selected file name separated by a newline while read -r file; do - set -- "$@" "$file" + set -- "$@" "$(realpath --relative-to="$(pwd)" "$file")" done <"$(echo "$fx" | tmp)" case "$archiver" in @@ -63,7 +57,7 @@ case "$archiver" in 7z a "$name" "$@" ;; "zip") - zip --symlinks -9 -r "$name" "$@" + zip --symlinks -9 --recurse-paths "$name" "$@" ;; esac # vim: ft=sh diff --git a/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh index 142ac4d2..08374176 100755 --- a/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh +++ b/modules/by-name/lf/lf/commands/scripts/archive_decompress.sh @@ -9,8 +9,6 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -set -f - echo "$fx" | while read -r file; do case "$file" in *.tar.bz | *.tar.bz2 | *.tbz | *.tbz2) tar --extract --bzip2 --verbose --file="$file" ;; |