refactor: improve fs_* (#99)

improve `_guard_path` to use `realpath -m <path>` to get absolute path
This commit is contained in:
sigoden authored and GitHub committed 2024-08-17 12:40:32 +08:00
1 parent a53ca4fda2
commit 760ea38fed
4 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ main() {
}
_guard_path() {
path="$(realpath "$1")"
path="$(realpath -m "$1")"
action="$2"
if [[ ! "$path" == "$(pwd)"* ]]; then
if [ -t 1 ]; then
+1 -1
View File
@@ -17,7 +17,7 @@ main() {
}
_guard_path() {
path="$(realpath "$1")"
path="$(realpath -m "$1")"
action="$2"
if [[ ! "$path" == "$(pwd)"* ]]; then
if [ -t 1 ]; then