From 18336d643163a6b339f6198c7f53b109ee58bdf7 Mon Sep 17 00:00:00 2001 From: Linnnus Date: Sat, 16 Nov 2024 13:00:36 +0100 Subject: home: Add stat wrapper for OSX --- home/shell-utils/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 + '') ]; } -- cgit v1.2.3