mirror of
				https://gitea.blesmrt.net/mikaela/scripts.git
				synced 2025-11-03 19:07:21 +01:00 
			
		
		
		
	bash/usr-local-bin/go: hardcode go version for Debian fallback
TODO: FIXME: this version should be figured automatically, why is it just not available in update-alternatives?
This commit is contained in:
		
							parent
							
								
									e1f287a454
								
							
						
					
					
						commit
						db9ab6a0e9
					
				@ -1,16 +1,24 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
# Using the snap version of go if available
 | 
			
		||||
# 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 $@
 | 
			
		||||
	snap run go "$@"
 | 
			
		||||
 | 
			
		||||
# Fallback to system installation
 | 
			
		||||
# 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 $@
 | 
			
		||||
	/usr/bin/go "$@"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
set +x
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user