mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-25 13:03:04 +07:00
Fix composer permissions on unix
This commit is contained in:
parent
9d1fe69816
commit
b57416e44d
@ -147,9 +147,14 @@ configure_composer() {
|
|||||||
add_log "$cross" "composer" "Could not download composer"
|
add_log "$cross" "composer" "Could not download composer"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
if ! [ -d "$composer_home" ]; then
|
||||||
|
sudo -u "$(id -un)" -g "$(id -gn)" mkdir -p -m=00755 "$composer_home"
|
||||||
|
else
|
||||||
|
sudo chown -R "$(id -un)":"$(id -gn)" "$composer_home"
|
||||||
|
fi
|
||||||
if ! [ -e "$composer_json" ]; then
|
if ! [ -e "$composer_json" ]; then
|
||||||
echo '{}' | tee "$composer_json" >/dev/null 2>&1
|
echo '{}' | tee "$composer_json" >/dev/null
|
||||||
sudo chmod 644 "$composer_json"
|
chmod 644 "$composer_json"
|
||||||
fi
|
fi
|
||||||
composer -q config -g process-timeout 0
|
composer -q config -g process-timeout 0
|
||||||
echo "$composer_bin" >> "$GITHUB_PATH"
|
echo "$composer_bin" >> "$GITHUB_PATH"
|
||||||
@ -297,9 +302,10 @@ version=$1
|
|||||||
dist=$2
|
dist=$2
|
||||||
tool_path_dir="/usr/local/bin"
|
tool_path_dir="/usr/local/bin"
|
||||||
curl_opts=(-sL)
|
curl_opts=(-sL)
|
||||||
composer_bin="$HOME/.composer/vendor/bin"
|
composer_home="$HOME/.composer"
|
||||||
composer_json="$HOME/.composer/composer.json"
|
composer_bin="$composer_home/vendor/bin"
|
||||||
composer_lock="$HOME/.composer/composer.lock"
|
composer_json="$composer_home/composer.json"
|
||||||
|
composer_lock="$composer_home/composer.lock"
|
||||||
brew_prefix="$(brew --prefix)"
|
brew_prefix="$(brew --prefix)"
|
||||||
brew_repo="$(brew --repository)"
|
brew_repo="$(brew --repository)"
|
||||||
tap_dir="$brew_repo"/Library/Taps
|
tap_dir="$brew_repo"/Library/Taps
|
||||||
|
@ -182,10 +182,14 @@ configure_composer() {
|
|||||||
add_log "$cross" "composer" "Could not download composer"
|
add_log "$cross" "composer" "Could not download composer"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
if ! [ -d "$composer_home" ]; then
|
||||||
|
sudo -u "$(id -un)" -g "$(id -gn)" mkdir -p -m=00755 "$composer_home"
|
||||||
|
else
|
||||||
|
sudo chown -R "$(id -un)":"$(id -gn)" "$composer_home"
|
||||||
|
fi
|
||||||
if ! [ -e "$composer_json" ]; then
|
if ! [ -e "$composer_json" ]; then
|
||||||
sudo mkdir -p "$(dirname "$composer_json")"
|
echo '{}' | tee "$composer_json" >/dev/null
|
||||||
echo '{}' | tee "$composer_json" >/dev/null 2>&1
|
chmod 644 "$composer_json"
|
||||||
sudo chmod 644 "$composer_json"
|
|
||||||
fi
|
fi
|
||||||
composer -q config -g process-timeout 0
|
composer -q config -g process-timeout 0
|
||||||
echo "$composer_bin" >> "$GITHUB_PATH"
|
echo "$composer_bin" >> "$GITHUB_PATH"
|
||||||
@ -320,9 +324,10 @@ debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
|||||||
apt_install="sudo $debconf_fix apt-fast install -y"
|
apt_install="sudo $debconf_fix apt-fast install -y"
|
||||||
tool_path_dir="/usr/local/bin"
|
tool_path_dir="/usr/local/bin"
|
||||||
curl_opts=(-sL)
|
curl_opts=(-sL)
|
||||||
composer_bin="$HOME/.composer/vendor/bin"
|
composer_home="$HOME/.composer"
|
||||||
composer_json="$HOME/.composer/composer.json"
|
composer_bin="$composer_home/vendor/bin"
|
||||||
composer_lock="$HOME/.composer/composer.lock"
|
composer_json="$composer_home/composer.json"
|
||||||
|
composer_lock="$composer_home/composer.lock"
|
||||||
existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
|
existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
|
||||||
|
|
||||||
# Setup PHP
|
# Setup PHP
|
||||||
|
Loading…
Reference in New Issue
Block a user