mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
Merge pull request #379 from dritter/fix_swift_segment
Fix swift segment
This commit is contained in:
commit
a58e8bdc8c
1 changed files with 2 additions and 4 deletions
|
@ -1107,12 +1107,10 @@ prompt_pyenv() {
|
||||||
|
|
||||||
# Swift version
|
# Swift version
|
||||||
prompt_swift_version() {
|
prompt_swift_version() {
|
||||||
local swift_version=($(swift --version 2>/dev/null))
|
# Get the first number as this is probably the "main" version number..
|
||||||
|
local swift_version=$(swift --version 2>/dev/null | grep -o -E "[0-9.]+" | head -n 1)
|
||||||
[[ -z "${swift_version}" ]] && return
|
[[ -z "${swift_version}" ]] && return
|
||||||
|
|
||||||
# Extract semantic version
|
|
||||||
swift_version=$(echo ${swift_version} | sed -e 's/[^0-9.]*\([0-9.]*\).*/\1/')
|
|
||||||
|
|
||||||
"$1_prompt_segment" "$0" "$2" "magenta" "white" "${swift_version}" 'SWIFT_ICON'
|
"$1_prompt_segment" "$0" "$2" "magenta" "white" "${swift_version}" 'SWIFT_ICON'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue