summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorAhmed ElSamhaa <assamhaa@gmail.com>2023-04-05 11:54:19 +0300
committerAhmed ElSamhaa <assamhaa@gmail.com>2023-04-05 11:54:19 +0300
commit5561e6a8f591e7ceed83bdefc686abdff48dbee0 (patch)
tree5f917d0805202e1eac678126f2a0fef950faae81 /README.md
parent91d3f16d66da3e9bebd3b1097e011ca59cfe645f (diff)
Optimizes the calling shell function to match "Platform-specific behavior" of std::env::temp_dir
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/README.md b/README.md
index 5c8776f..421d8c6 100644
--- a/README.md
+++ b/README.md
@@ -113,12 +113,14 @@ fx() {
set -e
if [ -n "$XDG_RUNTIME_DIR" ]; then
local runtime_dir="$XDG_RUNTIME_DIR/felix"
- else
+ elif [ -n "$TMPDIR" ]; then
local runtime_dir="$TMPDIR/felix"
+ else
+ local runtime_dir=/tmp/felix
fi
cat "$runtime_dir/$$"
# Clean up the current and any leftover lwd files
- find "$runtime_dir" \( -type f -mtime +1s -or -name $$ \) -delete
+ find "$runtime_dir" -type f -and \( -mtime +1s -or -name $$ \) -delete
)"
}
```