Merge pull request #229 from alexlafroscia/add-package-name-shortening-strategy

Add shortening strategy based on package.json name
This commit is contained in:
Ben Hilburn
2016-04-11 15:16:37 -04:00
3 changed files with 53 additions and 2 deletions
+6
View File
@@ -186,3 +186,9 @@ function segmentShouldBeJoined() {
return 1
fi
}
# Given a directory path, truncate it according to the settings for
# `truncate_from_right`
function truncatePathFromRight() {
echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+\//\1$POWERLEVEL9K_SHORTEN_DELIMITER\//g"
}