sh Laravel Homestead配置脚本,包括WP-CLI和AWS-CLI
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Laravel Homestead配置脚本,包括WP-CLI和AWS-CLI相关的知识,希望对你有一定的参考价值。
#!/bin/bash
# Functions for later
noroot() {
sudo -EH -u "vagrant" "$@";
}
wp_cli() {
# WP-CLI Install
local exists_wpcli
# Remove old wp-cli symlink, if it exists.
if [[ -L "/usr/local/bin/wp" ]]; then
echo "Removing old wp-cli"
rm -f /usr/local/bin/wp
fi
exists_wpcli="$(which wp)"
if [[ "/usr/local/bin/wp" != "${exists_wpcli}" ]]; then
echo -e "Downloading wp-cli, see http://wp-cli.org"
sudo curl -sO https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar
sudo chmod +x wp-cli-nightly.phar
sudo mv wp-cli-nightly.phar /usr/local/bin/wp
# Install bash completions
sudo curl -s https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash -o /srv/config/wp-cli/wp-completion.bash
else
echo -e "Updating wp-cli..."
sudo wp --allow-root cli update --nightly --yes
fi
}
# Update apt-get
echo "Updating apt-get"
sudo DEBIAN_FRONTEND=noninteractive apt-get --assume-yes update
# Install phpX.X-ldap
echo "Installing phpX.X-ldap (matches current php version)"
PHPVersion=$(php --version | head -n 1 | cut -d " " -f 2 | cut -c 1,2,3);
sudo DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install php${PHPVersion}-ldap
# install/update WP-CLI
echo "Installing/updating wp-cli"
wp_cli
以上是关于sh Laravel Homestead配置脚本,包括WP-CLI和AWS-CLI的主要内容,如果未能解决你的问题,请参考以下文章
sh 在Laravel Homestead中安装MSSQL的脚本(阅读评论)
新的 laravel/homestead 配置中的 GitHub OAuth 令牌的 Composer 错误
sh Installeren Xdebug Homestead laravel
sh Windows上带有SMB的Laravel Homestead(“更快的共享文件夹”)
Laravel 的 Homestead 开发环境部署
Laravel5.5 的 Homestead 开发环境部署