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

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
- 
# After Submitting

N/A
This commit is contained in:
Douglas 2024-12-19 09:38:29 -05:00 committed by GitHub
parent 4e8289d7bb
commit 7029d24f42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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)
}