From 07428258fb8afb26e0620281d936a718143fc831 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Thu, 29 Nov 2018 19:53:54 -0500 Subject: [PATCH] Let's cut it out! - Remove existing references to cut - Remove unnecessary use of sort in git status Co-authored-by: Snuggle --- functions/__sf_section_git_status.fish | 2 +- scripts/version.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/__sf_section_git_status.fish b/functions/__sf_section_git_status.fish index 5cbee47..d704ca4 100644 --- a/functions/__sf_section_git_status.fish +++ b/functions/__sf_section_git_status.fish @@ -32,7 +32,7 @@ function __sf_section_git_status -d "Display the current git status" set -l is_behind set -l index (command git status --porcelain ^/dev/null -b) - set -l trimmed_index (string split \n $index|cut -c 1-2|sort -u) + set -g trimmed_index (string split \n $index | string sub --start 1 --length 2) for i in $trimmed_index if test (string match '\?\?' $i) diff --git a/scripts/version.fish b/scripts/version.fish index 894950d..7f4ad44 100755 --- a/scripts/version.fish +++ b/scripts/version.fish @@ -1,7 +1,7 @@ #!/usr/bin/env fish # Set the global "SPACEFISH_VERSION" variable to have the same version as is in package.json -set -l new_version (grep -E '"version": "v?([0-9]+\.){1,}' package.json | cut -d\" -f4 2> /dev/null) +set -l new_version (grep -E '"version": "v?([0-9]+\.){1,}' package.json | string split \" ^/dev/null)[4] set -l filename $PWD/fish_prompt.fish sed -e "s/set -g SPACEFISH_VERSION .*/set -g SPACEFISH_VERSION $new_version/g" $filename > $filename.bak