From 7029d24f4218f41a3a487ff7461a311cc88f09b9 Mon Sep 17 00:00:00 2001 From: Douglas <32344964+NotTheDr01ds@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:38:29 -0500 Subject: [PATCH] Add version info to startup banner (#14625) # Description Adds version info to the Startup Banner # User-Facing Changes ## Before ![image](https://github.com/user-attachments/assets/de2a415f-1608-4d87-ab28-f3238cf532c3) ## After ![image](https://github.com/user-attachments/assets/db3f8419-0680-4a0b-9f09-8d9a273c4726) # Tests + Formatting - :green_circle: `toolkit fmt` - :green_circle: `toolkit clippy` - :green_circle: `toolkit test` - :green_circle: `toolkit test stdlib` - # After Submitting N/A --- crates/nu-std/std/core/mod.nu | 2 ++ crates/nu-std/tests/test_core.nu | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/nu-std/std/core/mod.nu b/crates/nu-std/std/core/mod.nu index 2c4a863426..3a010c1fb3 100644 --- a/crates/nu-std/std/core/mod.nu +++ b/crates/nu-std/std/core/mod.nu @@ -3,12 +3,14 @@ use std/dt [datetime-diff, pretty-print-duration] # Print a banner for nushell with information about the project export def banner [] { let dt = (datetime-diff (date now) 2019-05-10T09:59:12-07:00) +let ver = (version) let banner_msg = $"(ansi green) __ ,(ansi reset) (ansi green) .--\(\)°'.' (ansi reset)Welcome to (ansi green)Nushell(ansi reset), (ansi green)'|, . ,' (ansi reset)based on the (ansi green)nu(ansi reset) language, (ansi green) !_-\(_\\ (ansi reset)where all data is structured! +Version: (ansi green)($ver.version) \(($ver.build_os)\) Please join our (ansi purple)Discord(ansi reset) community at (ansi purple)https://discord.gg/NtAbbGn(ansi reset) Our (ansi green_bold)GitHub(ansi reset) repository is at (ansi green_bold)https://github.com/nushell/nushell(ansi reset) Our (ansi green)Documentation(ansi reset) is located at (ansi green)https://nushell.sh(ansi reset) diff --git a/crates/nu-std/tests/test_core.nu b/crates/nu-std/tests/test_core.nu index eca7cddd61..654a1bcedf 100644 --- a/crates/nu-std/tests/test_core.nu +++ b/crates/nu-std/tests/test_core.nu @@ -3,5 +3,5 @@ use std/assert #[test] def banner [] { use std/core - assert ((core banner | lines | length) == 15) + assert ((core banner | lines | length) == 16) }