diff options
author | Ahmed ElSamhaa <assamhaa@gmail.com> | 2023-04-05 11:54:19 +0300 |
---|---|---|
committer | Ahmed ElSamhaa <assamhaa@gmail.com> | 2023-04-05 11:54:19 +0300 |
commit | 5561e6a8f591e7ceed83bdefc686abdff48dbee0 (patch) | |
tree | 5f917d0805202e1eac678126f2a0fef950faae81 /README.md | |
parent | 91d3f16d66da3e9bebd3b1097e011ca59cfe645f (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.md | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 )" } ``` |