aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/lf
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-03 13:46:02 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-03 13:46:02 +0100
commite593c4e2c36ba7ac3be7180fada09535ea745b05 (patch)
tree672fa8a693681fe4b4471d03fd9fd798bd5e303f /modules/by-name/lf
parentfix(modules/lf/commands/archive_decompress): Pipe the filenames not the file (diff)
downloadnixos-config-e593c4e2c36ba7ac3be7180fada09535ea745b05.zip
fix(modules/lf/commands/archive_{compress,decompress}): Correctly store paths
Diffstat (limited to 'modules/by-name/lf')
-rwxr-xr-xmodules/by-name/lf/lf/commands/scripts/archive_compress.sh10
-rwxr-xr-xmodules/by-name/lf/lf/commands/scripts/archive_decompress.sh2
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" ;;