From 441fd810a052bfe93e109f5599e0d7bd36124b17 Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Tue, 21 Aug 2018 17:43:39 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9solution=20bug=20$title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wp-cli/install_wp.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/wp-cli/install_wp.sh b/wp-cli/install_wp.sh index ae1ece5..fa3dc55 100755 --- a/wp-cli/install_wp.sh +++ b/wp-cli/install_wp.sh @@ -76,7 +76,7 @@ if [ -n "$exist" ]; then # /home/bruno/Sites/wordpress/wp-includes/version.php wp_exist="$(dirname $(dirname $exist))" - + wp_folder_name=$(echo "$exist" | awk -F "/" '{for (i=1;i<=NF;i++) if ($i=="wp-includes") print $(i-1)}') read -p $'\n\033[1;31mWordPress is already installed. Do you really want to erase it ? \033[39m(y/n)\033[0m' choice @@ -124,7 +124,12 @@ db=$(wp db create --path=$path) # Installer WordPress: # Si sh: 1: /usr/sbin/sendmail: not found => ajouter --skip-email -co=$(wp core install --path=$path --url=$url --title='$title' --admin_user=$admin_user --admin_password=$admin_password --admin_email=$admin_email --skip-email) +#OK +#co=$(wp core install --path=$path --url=$url --title="echo $title" --admin_user=$admin_user --admin_password=$admin_password --admin_email=$admin_email --skip-email) +#Error: Too many positional arguments: WordPress Blog +#co=$(wp core install --path=$path --url=$url --title=$title --admin_user=$admin_user --admin_password=$admin_password --admin_email=$admin_email --skip-email) +# +co=$(wp core install --path=$path --url=$url --title="$title" --admin_user=$admin_user --admin_password=$admin_password --admin_email=$admin_email --skip-email) #if [ $? != 0 ]; then echo "$co"; fi # Changement de la structure des liens pour ne conserver que le nom de l'article: @@ -150,6 +155,12 @@ ac=$(wp theme activate --path=$path $default_theme) pl=$(wp plugin install --path=$path $defaults_plugins --activate) #if [ $? != 0 ]; then echo -e "\033[31mErrors log:\033[0m" && echo "$pl\n"; fi +echo "title= $title" + +echo "1blogname: : $(wp option get blogname --path=$path)" + +#wp option update blogname $title --path=$path + # Installer les packages: for i in $defaults_packages @@ -159,7 +170,7 @@ do #if [ $? != 0 ]; then echo "$pa"; fi else echo "Info: $i already installed !" - fi + fi done # Ouvrir le tableau de bord dans un navigateur: @@ -169,5 +180,3 @@ if [ "$admin" = true ]; then echo -e "\n\033[1mOpen wp-admin/ page in browser...\033[0m" wp admin --path=$path fi - -