From eddc4d75728bfecb1d1236213d084f49f1688528 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 18 Jul 2017 14:51:09 +0100 Subject: [PATCH] Make prompt show url when in site folder The url will be the folder name above public_html and .local appended to it. --- config/oh-my-zsh/promptconfig.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/oh-my-zsh/promptconfig.zsh b/config/oh-my-zsh/promptconfig.zsh index 09d64678..c1709c74 100644 --- a/config/oh-my-zsh/promptconfig.zsh +++ b/config/oh-my-zsh/promptconfig.zsh @@ -25,12 +25,11 @@ function my_dir(){ #This is used for checking if wp or magento local ph=${PWD%/public_html*}/public_html - # If in a site folder and a wp site, replace home/Sites//public_html with siteIcon + # If in a site folder and a wp site, replace home/Sites//public_html with siteIcon if [[ -d $ph ]]; then local icon=$siteIcon if [[ -e "$ph/wp-config.php" ]]; then #If WordPress icon=$wpSiteIcon - current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Sites\/([a-z_\-]*)\/public_html/$wpSiteIcon\1/") # Change wp-content in sub folders current_path=$(echo $current_path | sed -r -e "s/wp\-content\//wpc\//") @@ -38,7 +37,7 @@ function my_dir(){ elif [[ -d "$ph/pub/opt/magento" ]]; then #If magento icon=$magentoSiteIcon fi - current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Sites\/([a-z_\-]*)\/public_html/$icon\1/") + current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Sites\/([a-z_\-]*)\/public_html/$icon\1.local/") fi