-
-
Notifications
You must be signed in to change notification settings - Fork 326
/
symfony.sh
22 lines (21 loc) · 835 Bytes
/
symfony.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
add_symfony_helper() {
if [ "$(uname -s)" = "Linux" ]; then
arch=$(dpkg --print-architecture)
get -s -n "" "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_linux_$arch.tar.gz" | sudo tar -xz -C "${tool_path_dir:?}"
sudo chmod a+x /usr/local/bin/symfony
elif [ "$(uname -s)" = "Darwin" ]; then
add_brew_tap symfony-cli/homebrew-tap
brew install symfony-cli/tap/symfony-cli
fi
}
add_symfony() {
add_symfony_helper >/dev/null 2>&1
symfony_path="$(command -v symfony)"
if [[ -n "$symfony_path" ]]; then
sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli
tool_version=$(get_tool_version "symfony" "-V")
add_log "${tick:?}" "symfony-cli" "Added symfony-cli $tool_version"
else
add_log "${cross:?}" "symfony-cli" "Could not setup symfony-cli"
fi
}