Add perimission for composer self-update

This commit is contained in:
Shivam Mathur 2020-02-25 23:00:30 +05:30
parent 5de6285e1f
commit 99161b7790
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 5 additions and 5 deletions

View File

@ -95,7 +95,6 @@ add_unstable_extension() {
add_tool() {
url=$1
tool=$2
tool_path_dir=/usr/local/bin
tool_path="$tool_path_dir/$tool"
if [ ! -e "$tool_path" ]; then
rm -rf "$tool_path"
@ -186,7 +185,8 @@ tick="✓"
cross="✗"
version=$1
old_versions="5.[3-5]"
php5=/usr/local/php5
php5="/usr/local/php5"
tool_path_dir="/usr/local/bin"
existing_version=$(php-config --version | cut -c 1-3)
[[ -z "${update}" ]] && update='false' || update="${update}"
@ -205,7 +205,7 @@ else
status="Found"
fi
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
sudo chmod 777 "$ini_file"
sudo chmod 777 "$ini_file" "$tool_path_dir"
echo "date.timezone=UTC" >>"$ini_file"
echo "detect_unicode=Off" >>"$ini_file"
ext_dir=$(php -i | grep -Ei "extension_dir => /usr" | sed -e "s|.*=> s*||")

View File

@ -148,7 +148,6 @@ update_extension() {
add_tool() {
url=$1
tool=$2
tool_path_dir=/usr/local/bin
tool_path="$tool_path_dir/$tool"
if [ ! -e "$tool_path" ]; then
rm -rf "$tool_path"
@ -274,6 +273,7 @@ version=$1
old_versions="5.[4-5]"
debconf_fix="DEBIAN_FRONTEND=noninteractive"
apt_install="sudo $debconf_fix apt-fast install -y"
tool_path_dir="/usr/local/bin"
existing_version=$(php-config --version | cut -c 1-3)
[[ -z "${update}" ]] && update='false' || update="${update}"
@ -317,5 +317,5 @@ semver=$(php_semver)
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||")
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
sudo chmod 777 "$ini_file"
sudo chmod 777 "$ini_file" "$tool_path_dir"
add_log "$tick" "PHP" "$status PHP $semver"