diff options
author | Linnnus <[email protected]> | 2024-11-16 13:00:36 +0100 |
---|---|---|
committer | Linnnus <[email protected]> | 2024-11-16 13:00:36 +0100 |
commit | 18336d643163a6b339f6198c7f53b109ee58bdf7 (patch) | |
tree | b986b6ee6e51a4d01d110b0f82ae08460bc37a06 | |
parent | 1c3e554e7f77a6d2a2374ef4fe32bf0d287dfd40 (diff) |
home: Add stat wrapper for OSX
-rw-r--r-- | home/shell-utils/default.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/home/shell-utils/default.nix b/home/shell-utils/default.nix index 0207d40..c3ea75e 100644 --- a/home/shell-utils/default.nix +++ b/home/shell-utils/default.nix @@ -17,5 +17,16 @@ in { pbv trash disable-sleep + + # Unlike the `stat` command on Linux (from coreutils or whatever), OSX's + # `stat` does not automatically use the nicer format when stdout is a + # sterminal. + (pkgs.writeShellScriptBin "stat" '' + if [ -t 1 ]; then + /usr/bin/stat -x "$@" + else + /usr/bin/stat "$@" + fi + '') ]; } |