1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00

Update ynh_install_go

This commit is contained in:
ericgaspar 2022-10-18 09:37:34 +02:00
parent d06e86dbdd
commit 3e3aa88aa7

View file

@ -123,7 +123,7 @@ ynh_install_go () {
fi fi
popd popd
else else
ynh_print_info --message="Installing goenv with Git..." #ynh_print_info --message="Installing goenv with Git..."
mkdir -p $goenv_install_dir mkdir -p $goenv_install_dir
pushd $goenv_install_dir pushd $goenv_install_dir
git init -q git init -q
@ -144,7 +144,7 @@ ynh_install_go () {
fi fi
popd popd
else else
ynh_print_info --message="Installing xxenv-latest with Git..." #ynh_print_info --message="Installing xxenv-latest with Git..."
mkdir -p "${goenv_install_dir}/plugins" mkdir -p "${goenv_install_dir}/plugins"
git clone -q https://github.com/momo-lab/xxenv-latest.git "${goenv_install_dir}/plugins/xxenv-latest" git clone -q https://github.com/momo-lab/xxenv-latest.git "${goenv_install_dir}/plugins/xxenv-latest"
fi fi
@ -163,7 +163,7 @@ ynh_install_go () {
# Install the requested version of Go # Install the requested version of Go
local final_go_version=$(goenv latest --print $go_version) local final_go_version=$(goenv latest --print $go_version)
ynh_print_info --message="Installation of Go-$final_go_version" #ynh_print_info --message="Installation of Go-$final_go_version"
goenv install --skip-existing $final_go_version goenv install --skip-existing $final_go_version
# Store go_version into the config of this app # Store go_version into the config of this app
@ -231,7 +231,7 @@ ynh_cleanup_go () {
do do
if ! `echo ${required_go_versions} | grep "${installed_go_version}" 1>/dev/null 2>&1` if ! `echo ${required_go_versions} | grep "${installed_go_version}" 1>/dev/null 2>&1`
then then
ynh_print_info --message="Removing of Go-$installed_go_version" #ynh_print_info --message="Removing of Go-$installed_go_version"
$goenv_install_dir/bin/goenv uninstall --force $installed_go_version $goenv_install_dir/bin/goenv uninstall --force $installed_go_version
fi fi
done done
@ -240,7 +240,7 @@ ynh_cleanup_go () {
if [[ ! $required_go_versions ]] if [[ ! $required_go_versions ]]
then then
# Remove goenv environment configuration # Remove goenv environment configuration
ynh_print_info --message="Removing of goenv" #ynh_print_info --message="Removing of goenv"
ynh_secure_remove --file="$goenv_install_dir" ynh_secure_remove --file="$goenv_install_dir"
ynh_secure_remove --file="/etc/profile.d/goenv.sh" ynh_secure_remove --file="/etc/profile.d/goenv.sh"
fi fi