Work on stuff
This commit is contained in:
parent
6d215cee2d
commit
81dce313ad
4 changed files with 32 additions and 7 deletions
|
@ -43,6 +43,8 @@ ln -s -f $phpcgi /opt/lampp/bin/php-cgi
|
||||||
ln -s -f $phpconfig /opt/lampp/bin/php-config
|
ln -s -f $phpconfig /opt/lampp/bin/php-config
|
||||||
ln -s -f $phpize /opt/lampp/bin/phpize
|
ln -s -f $phpize /opt/lampp/bin/phpize
|
||||||
|
|
||||||
|
# Also need to change /opt/lampp/modules/libphp7.so if 7.x.
|
||||||
|
|
||||||
$lampp startapache
|
$lampp startapache
|
||||||
echo
|
echo
|
||||||
echo "Now on PHP ${phpexe##*-}"
|
echo "Now on PHP ${phpexe##*-}"
|
||||||
|
|
|
@ -77,7 +77,7 @@ function themes() {
|
||||||
if [ -d $themes ]; then
|
if [ -d $themes ]; then
|
||||||
cdlc $themes
|
cdlc $themes
|
||||||
else
|
else
|
||||||
echo " Can't find plugins folder "
|
echo " Can't find theme folder "
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo " Can't find public_html folder."
|
echo " Can't find public_html folder."
|
||||||
|
|
|
@ -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")
|
||||||
|
|
3
zshrc
3
zshrc
|
@ -84,3 +84,6 @@ source $ZSH/oh-my-zsh.sh
|
||||||
# Example aliases
|
# Example aliases
|
||||||
# alias zshconfig="mate ~/.zshrc"
|
# alias zshconfig="mate ~/.zshrc"
|
||||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||||
|
|
||||||
|
[ -r "$HOME/.smartcd_config" ] && ( [ -n $BASH_VERSION ] || [ -n $ZSH_VERSION ] ) && source ~/.smartcd_config
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue