|
|
@ -6,8 +6,11 @@ function my_dir(){ |
|
|
|
wpPluginsIcon=".p." |
|
|
|
wpPluginsIcon=".p." |
|
|
|
wpThemesIcon=".t." |
|
|
|
wpThemesIcon=".t." |
|
|
|
siteIcon=" " |
|
|
|
siteIcon=" " |
|
|
|
|
|
|
|
wpSiteIcon=" " |
|
|
|
|
|
|
|
magentoSiteIcon=" " |
|
|
|
dropboxIcon=" " |
|
|
|
dropboxIcon=" " |
|
|
|
seperator="" |
|
|
|
seperator=" " |
|
|
|
|
|
|
|
root=" " |
|
|
|
# Gets the path. |
|
|
|
# Gets the path. |
|
|
|
local current_path="$(print -P "%~")" |
|
|
|
local current_path="$(print -P "%~")" |
|
|
|
|
|
|
|
|
|
|
@ -20,14 +23,31 @@ function my_dir(){ |
|
|
|
# Replace wp-content/plugins with plugin icon if in plugin |
|
|
|
# Replace wp-content/plugins with plugin icon if in plugin |
|
|
|
# current_path=$(echo $current_path | sed -r -e "s/wp\-content\/plugins/$wpPluginsIcon/") |
|
|
|
# current_path=$(echo $current_path | sed -r -e "s/wp\-content\/plugins/$wpPluginsIcon/") |
|
|
|
|
|
|
|
|
|
|
|
# If in a site folder, replace home/Sites/<site-name>/public_html with siteIcon <site-name> |
|
|
|
#This is used for checking if wp or magento |
|
|
|
current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Sites\/([a-z_\-]*)\/public_html/$siteIcon\1/") |
|
|
|
local ph=${PWD%/public_html*}/public_html |
|
|
|
|
|
|
|
# If in a site folder and a wp site, replace home/Sites/<site-name>/public_html with siteIcon <site-name> |
|
|
|
|
|
|
|
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\//") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/") |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Replace Dropbox with icon |
|
|
|
# Replace Dropbox with icon |
|
|
|
current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Dropbox/$dropboxIcon/") |
|
|
|
current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Dropbox/$dropboxIcon/") |
|
|
|
|
|
|
|
|
|
|
|
# Change wp-content in sub folders |
|
|
|
|
|
|
|
current_path=$(echo $current_path | sed -r -e "s/wp\-content\//wpc\//") |
|
|
|
# Set the root |
|
|
|
|
|
|
|
current_path=$(echo $current_path | sed -r -e "s/^\//$root/g") |
|
|
|
|
|
|
|
|
|
|
|
# Set the seperator |
|
|
|
# Set the seperator |
|
|
|
current_path=$(echo $current_path | sed -r -e "s/\//$seperator/g") |
|
|
|
current_path=$(echo $current_path | sed -r -e "s/\//$seperator/g") |
|
|
|