aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2021-06-27 00:43:35 -0400
committertdro <tdro@users.noreply.github.com>2021-06-27 00:43:35 -0400
commit7ebe6507251b80b8e207d5d7de4af17c4c94c10f (patch)
tree12480b540dbd5eda6645382b7c8bb95502a625f2
parentd387acc4b7da72c8fb39321896920b7d35477bba (diff)
downloaddotfiles-7ebe6507251b80b8e207d5d7de4af17c4c94c10f.tar.gz
dotfiles-7ebe6507251b80b8e207d5d7de4af17c4c94c10f.tar.bz2
dotfiles-7ebe6507251b80b8e207d5d7de4af17c4c94c10f.zip
.local/bin/,: Provide tree in pure shell
Print path if bin missing.
-rwxr-xr-x.local/bin/,7
1 files changed, 4 insertions, 3 deletions
diff --git a/.local/bin/, b/.local/bin/,
index aafa5ef..19de198 100755
--- a/.local/bin/,
+++ b/.local/bin/,
@@ -30,12 +30,13 @@ attributes=$($nixLocate | while read -r attribute; do
done)
attribute=$(printf '%s' "$attributes" | fzf)
-nix-shell --pure --keep TERMINFO_DIRS --packages "$attribute" --command \
+nix-shell --pure --keep TERMINFO_DIRS --packages "$attribute" tree --command \
'
export HOME=$(mktemp --directory --suffix -nix-shell-tmp-home)
+ program=$(printf "%s" "$buildInputs" | cut --delimiter=" " --fields=1)
printf "\n";
- ls $buildInputs/bin;
+ { [ -d "$program/bin" ] && ls "$program/bin"; } || printf "%s\n" "$program";
printf "\n";
- tree -L 1 $buildInputs;
+ tree -L 1 "$program";
return
';