mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-11-01 00:19:22 +01:00
Aminda Suomalainen
db9ab6a0e9
TODO: FIXME: this version should be figured automatically, why is it just not available in update-alternatives?
25 lines
451 B
Bash
Executable File
25 lines
451 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Using the snap version of go if available. Or wherever Debian hides newer
|
|
# Go
|
|
|
|
set -x
|
|
|
|
# TODO: this should be automatic
|
|
export GOVERSION=1.21
|
|
|
|
# Check if go is installed through snap
|
|
if [ -f /snap/bin/go ]; then
|
|
snap run go "$@"
|
|
|
|
# Or if Debian hides it somewhere nice.
|
|
elif [ -f /usr/lib/go-$GOVERSION/bin/go ]; then
|
|
/usr/lib/go-$GOVERSION/bin/go "$@"
|
|
|
|
# Fallback to system default version
|
|
else
|
|
/usr/bin/go "$@"
|
|
fi
|
|
|
|
set +x
|