spaceship-prompt 4.16.2 → 4.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024-2016 [Denys Dovhan](https://denysdovhan.com)
3
+ Copyright (c) 2025-2016 [Denys Dovhan](https://denysdovhan.com)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -304,7 +304,6 @@ If you really enjoy this project, you can contribute financially. Any contributi
304
304
  * **One-time donations**:
305
305
  * [GitHub Sponsors](https://github.com/sponsors/denysdovhan?frequency=one-time)
306
306
  * [Buy Me A Coffee](https://buymeacoffee.com/denysdovhan)
307
- * [Monobank Jar](https://send.monobank.ua/jar/2N46sWTaZZ)
308
307
  * **Crypto donations**:
309
308
  * Ethereum: `0x5C9496De5E51D48daf28354DC04d8f9D33955559`
310
309
  * Bitcoin: `bc1q5ezjvpgftmx42f9qgdf5lscjz43uh4jf02uvje`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spaceship-prompt",
3
- "version": "4.16.2",
3
+ "version": "4.18.0",
4
4
  "description": "A Zsh prompt for Astronauts.",
5
5
  "files": [
6
6
  "lib",
package/scripts/install CHANGED
@@ -4,6 +4,7 @@
4
4
  # https://github.com/spaceship-prompt/spaceship-prompt
5
5
 
6
6
  # Stop on errors
7
+ set -e
7
8
 
8
9
  echo
9
10
  echo "1. Add the following to your \`.zshrc\`:"
package/sections/bun.zsh CHANGED
@@ -24,7 +24,7 @@ spaceship_bun() {
24
24
  [[ $SPACESHIP_BUN_SHOW == false ]] && return
25
25
 
26
26
  # Find Bun-specific files or return
27
- spaceship::upsearch -s bun.lockb bunfig.toml || return
27
+ spaceship::upsearch -s bun.lockb bun.lock bunfig.toml || return
28
28
 
29
29
  # Find Bun binary
30
30
  spaceship::exists bun || return
@@ -34,7 +34,7 @@ spaceship_elixir() {
34
34
  elif spaceship::exists exenv; then
35
35
  elixir_version=$(exenv version-name)
36
36
  elif spaceship::exists asdf; then
37
- elixir_version=${$(asdf current elixir)[2]}
37
+ elixir_version=${$(asdf current --no-header elixir)[2]}
38
38
  fi
39
39
 
40
40
  if [[ $elixir_version == "" ]]; then
@@ -0,0 +1,43 @@
1
+ #
2
+ # Gleam
3
+ #
4
+ # Gleam is a friendly language for building type-safe systems that scale!
5
+ # Link: https://gleam.run/
6
+
7
+ # ------------------------------------------------------------------------------
8
+ # Configuration
9
+ # ------------------------------------------------------------------------------
10
+
11
+ SPACESHIP_GLEAM_SHOW="${SPACESHIP_GLEAM_SHOW=true}"
12
+ SPACESHIP_GLEAM_ASYNC="${SPACESHIP_GLEAM_ASYNC=true}"
13
+ SPACESHIP_GLEAM_PREFIX="${SPACESHIP_GLEAM_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"}"
14
+ SPACESHIP_GLEAM_SUFFIX="${SPACESHIP_GLEAM_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"}"
15
+ SPACESHIP_GLEAM_SYMBOL="${SPACESHIP_GLEAM_SYMBOL="⭐ "}"
16
+ SPACESHIP_GLEAM_COLOR="${SPACESHIP_GLEAM_COLOR="#ff8cff"}"
17
+
18
+ # ------------------------------------------------------------------------------
19
+ # Section
20
+ # ------------------------------------------------------------------------------
21
+
22
+ # Show current version of Gleam
23
+ spaceship_gleam() {
24
+ [[ $SPACESHIP_GLEAM_SHOW == false ]] && return
25
+
26
+ # Return when gleam is not installed
27
+ spaceship::exists gleam || return
28
+
29
+ # Show Gleam status only for Gleam-specific folders
30
+ local is_gleam_project="$(spaceship::upsearch gleam.toml manifest.toml)"
31
+ [[ -n "$is_gleam_project" || -n *.gleam(#qN^/) ]] || return
32
+
33
+ local gleam_version="$(gleam --version 2>/dev/null | awk '{print $2}')"
34
+
35
+ [[ $gleam_version == "system" ]] && return
36
+
37
+ spaceship::section::v4 \
38
+ --color "$SPACESHIP_GLEAM_COLOR" \
39
+ --prefix "$SPACESHIP_GLEAM_PREFIX" \
40
+ --suffix "$SPACESHIP_GLEAM_SUFFIX" \
41
+ --symbol "$SPACESHIP_GLEAM_SYMBOL" \
42
+ "v$gleam_version"
43
+ }
package/sections/ruby.zsh CHANGED
@@ -37,7 +37,7 @@ spaceship_ruby() {
37
37
  ruby_version=$(rbenv version-name)
38
38
  elif spaceship::exists asdf; then
39
39
  # split output on space and return second element
40
- ruby_version=${$(asdf current ruby)[2]}
40
+ ruby_version=${$(asdf current --no-header ruby)[2]}
41
41
  else
42
42
  return
43
43
  fi
@@ -0,0 +1,46 @@
1
+ #
2
+ # uv
3
+ # uv is a Python package and project manager
4
+ # Link: docs.astral.sh/uv
5
+
6
+ # ------------------------------------------------------------------------------
7
+ # Configuration
8
+ # ------------------------------------------------------------------------------
9
+
10
+ SPACESHIP_UV_SHOW="${SPACESHIP_UV_SHOW=true}"
11
+ SPACESHIP_UV_ASYNC="${SPACESHIP_UV_ASYNC=true}"
12
+ SPACESHIP_UV_PREFIX="${SPACESHIP_UV_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"}"
13
+ SPACESHIP_UV_SUFFIX="${SPACESHIP_UV_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"}"
14
+ SPACESHIP_UV_SYMBOL="${SPACESHIP_UV_SYMBOL="uv "}"
15
+ SPACESHIP_UV_COLOR="${SPACESHIP_UV_COLOR="yellow"}"
16
+
17
+ # ------------------------------------------------------------------------------
18
+ # Section
19
+ # ------------------------------------------------------------------------------
20
+
21
+ # Show current version of Python
22
+ spaceship_uv() {
23
+ [[ $SPACESHIP_UV_SHOW == false ]] && return
24
+
25
+ [[ -n $VIRTUAL_ENV ]] && return
26
+
27
+ # Show python version only in directories with relevant files
28
+ local is_python_project="$(spaceship::upsearch uv.lock)"
29
+
30
+ [[ -n "$is_python_project" ]] || return
31
+
32
+ local venv=$is_python_project:h/.venv
33
+
34
+ if [[ -d $venv ]]; then
35
+ py_version=${(@)$($venv/bin/python -V 2>&1)[2]}
36
+ fi
37
+
38
+ [[ -z $py_version ]] && return
39
+
40
+ spaceship::section \
41
+ --color "$SPACESHIP_UV_COLOR" \
42
+ --prefix "$SPACESHIP_UV_PREFIX" \
43
+ --suffix "$SPACESHIP_UV_SUFFIX" \
44
+ --symbol "$SPACESHIP_UV_SYMBOL" \
45
+ "$py_version"
46
+ }
package/spaceship.zsh CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  # Current version of Spaceship
10
10
  # Useful for issue reporting
11
- export SPACESHIP_VERSION='4.16.2'
11
+ export SPACESHIP_VERSION='4.18.0'
12
12
 
13
13
  # Set SPACESHIP_ROOT if it isn't defined yet or if the directory does
14
14
  # not exist anymore (e.g. after an update to a newer version)
@@ -76,12 +76,14 @@ if [ -z "$SPACESHIP_PROMPT_ORDER" ]; then
76
76
  azure # Azure section
77
77
  venv # virtualenv section
78
78
  conda # conda virtualenv section
79
+ uv # uv virtualenv section
79
80
  dotnet # .NET section
80
81
  ocaml # OCaml section
81
82
  vlang # V section
82
83
  zig # Zig section
83
84
  purescript # PureScript section
84
85
  erlang # Erlang section
86
+ gleam # Gleam section
85
87
  kubectl # Kubectl context section
86
88
  ansible # Ansible section
87
89
  terraform # Terraform workspace section