From d5e02973addd6a30ae93ae01fb42b7e03c96f9b6 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Sat, 10 Aug 2024 18:28:10 -0500 Subject: [PATCH] update bins --- home/private_bin/executable_git-l | 15 +++------------ .../private_bin/executable_install-nu-plugins | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 home/private_bin/executable_install-nu-plugins diff --git a/home/private_bin/executable_git-l b/home/private_bin/executable_git-l index 4e322c4..b22bdf7 100644 --- a/home/private_bin/executable_git-l +++ b/home/private_bin/executable_git-l @@ -1,17 +1,8 @@ #!/usr/bin/env bash - -COLUMNS=$(tput cols) -PREFIX='%C(bold magenta)%h%C(reset)' -SUFFIX='%C(dim white)%aN%C(reset)%C(auto)%d%C(reset)' - -if [[ "$COLUMNS" -gt 100 ]]; then - format='%C(bold)%<(50,trunc)%s%C(reset) %C(green)%><(15,trunc)%ar%C(reset)' -else - format='%C(bold)%s%C(reset) %C(green)%as%C(reset)' -fi - -format="$PREFIX $format $SUFFIX" +PREFIX='%C(bold magenta)%h%C(reset)' # hash +SUFFIX='%C(auto)%d%C(reset) %C(dim white)%aN%C(reset)|%C(green)%ar%C(reset)' # branch, author, time +format="$PREFIX %C(bold)%s%C(reset)$SUFFIX" exec git \ log \ diff --git a/home/private_bin/executable_install-nu-plugins b/home/private_bin/executable_install-nu-plugins new file mode 100644 index 0000000..a3db698 --- /dev/null +++ b/home/private_bin/executable_install-nu-plugins @@ -0,0 +1,19 @@ +#!/usr/bin/env nu + +if (which cargo | length) == 0 { + print -e $"(ansi red)cargo not found(ansi reset)" + exit 1 +} + +cargo install nu_plugin_polars + +glob ~/.cargo/bin/nu_plugin_* +| each { |name| + print -e $">> (ansi cyan)($name)(ansi reset)" + try { + plugin add $name + } catch { |err| + print -e $"(ansi red)($err.msg)(ansi reset)" + } + } +| ignore