current_path=$(pwd | sed -e "s,^$HOME,~," | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+\//\1$POWERLEVEL9K_SHORTEN_DELIMITER\//g")
;;
truncate_with_package_name)
local name repo_path package_path current_dir zero
# Get the path of the Git repo, which should have the package.json file
if repo_path=$(git rev-parse --git-dir 2>/dev/null); then
if [[ "$repo_path" == ".git" ]]; then
# If the current path is the root of the project, then the package path is
# the current directory and we don't want to append anything to represent
# the path to a subdirectory
package_path="."
subdirectory_path=""
else
# If the current path is something else, get the path to the package.json
# file by finding the repo path and removing the '.git` from the path
package_path=${repo_path:0:-4}
zero='%([BSUbfksu]|([FB]|){*})'
current_dir=$(pwd)
# Then, find the length of the package_path string, and save the
# subdirectory path as a substring of the current directory's path from 0