Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Added changes from Spaceship upstream! 🚀⭐ #79

Merged
merged 2 commits into from
Oct 5, 2018
Merged

Added changes from Spaceship upstream! 🚀⭐ #79

merged 2 commits into from
Oct 5, 2018

Conversation

Snuggle
Copy link
Collaborator

@Snuggle Snuggle commented Oct 5, 2018

Description

This adds a config option to enable/disable verbose versioning,
which should be disabled by default.

Upstream pull request:
spaceship-prompt/spaceship-prompt#521

Motivation and Context

The original rust section displays the verbose version by default. For example: v1.30.0-nightly, v1.30.0-beta or v1.30.0, depending on what branch you were using. (Stable not having a suffix)

This change makes non-verbose version numbers the default v1.30.0, and a config option to enable it only if wanted.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
    (All three)

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux

I have tested using the ./tests/run.fish locally, as well as running logical snippets in my shell to make sure the syntax is correct.

Checklist:

  • I have checked that no other PR duplicates mine
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

This adds a config option to enable/disable verbose versioning,
which should be disabled by default.

Upstream pull request:
spaceship-prompt/spaceship-prompt#521
@Snuggle Snuggle self-assigned this Oct 5, 2018
@Snuggle Snuggle requested a review from matchai October 5, 2018 02:06
@@ -32,6 +33,10 @@ function __sf_section_rust -d "Display the current Rust version"

set -l rust_version (rustc --version | cut -d' ' -f2)
Copy link
Owner

@matchai matchai Oct 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking it over, I think the "fish way" of doing this would be.

set -l rust_version (rustc --version | string split ' ')[2]

It's effectively the same, but would be more approachable for those familiar with fish commands. Thoughts? 🤔

@Snuggle
Copy link
Collaborator Author

Snuggle commented Oct 5, 2018

OH! I totally forgot that fish already has a way to do this. Great thinking, @matchai!

This replaces the cut command with Fish's "string" builtin.
If you have fish installed, view "file:///usr/share/doc/fish/commands.html#string"
in your browser of choice.

Co-authored-by: Matan Kushner <hello@matchai.me>
Copy link
Owner

@matchai matchai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 👍

@matchai matchai merged commit e1a7876 into matchai:master Oct 5, 2018
@Snuggle Snuggle deleted the rust-is-very-rusty branch October 6, 2018 22:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants