add zig stuff

This commit is contained in:
Jacob Bohanon
2024-07-01 16:40:16 -04:00
parent b6689da485
commit 8ffa24ce52
7 changed files with 240 additions and 5 deletions

View File

@@ -148,11 +148,23 @@ elif [[ $1 == 'uninstall' ]]; then
elif [[ $1 == 'install' ]]; then
install_version $2
elif [[ $1 == 'use' ]]; then
check_exists $2
if [[ $exists == true ]]; then
link_version $2
if [[ $2 == 'local' ]]; then
go_mod_json=$(go mod edit -json)
if [[ $? == 1 ]]; then
echo "unable to find go.mod"
echo "using $(go version)"
exit 1
else
version_to_use=go$(jq -r .Go <<< $go_mod_json)
fi
else
prompt_install $2
version_to_use=$2
fi
check_exists $version_to_use
if [[ $exists == true ]]; then
link_version $version_to_use
else
prompt_install $version_to_use
fi
install_modules
elif [[ $1 == 'modules' ]]; then