From 760ea38fed35ed12b431faa538f4ed6269a1c174 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 17 Aug 2024 12:40:32 +0800 Subject: refactor: improve `fs_*` (#99) improve `_guard_path` to use `realpath -m ` to get absolute path --- tools/fs_rm.sh | 2 +- tools/fs_write.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/fs_rm.sh b/tools/fs_rm.sh index 89e9f95..77b5cee 100755 --- a/tools/fs_rm.sh +++ b/tools/fs_rm.sh @@ -14,7 +14,7 @@ main() { } _guard_path() { - path="$(realpath "$1")" + path="$(realpath -m "$1")" action="$2" if [[ ! "$path" == "$(pwd)"* ]]; then if [ -t 1 ]; then diff --git a/tools/fs_write.sh b/tools/fs_write.sh index 59ee812..b37a2d5 100755 --- a/tools/fs_write.sh +++ b/tools/fs_write.sh @@ -17,7 +17,7 @@ main() { } _guard_path() { - path="$(realpath "$1")" + path="$(realpath -m "$1")" action="$2" if [[ ! "$path" == "$(pwd)"* ]]; then if [ -t 1 ]; then -- cgit v1.2.3