mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-03-09 15:40:15 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			590 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			590 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/bin/sh
 | 
						|
while getopts ud option
 | 
						|
do
 | 
						|
  case "${option}"
 | 
						|
  in
 | 
						|
  u) UPX=true;;
 | 
						|
  d) DEBUG=true;;
 | 
						|
  esac
 | 
						|
done
 | 
						|
echo "Downloading..."
 | 
						|
for CMD in `ls cmd/` ; do
 | 
						|
  echo "Building: $CMD"
 | 
						|
  IMPRINT="-X github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil.buildName=$(sh contrib/semver/name.sh) -X github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil.buildVersion=$(sh contrib/semver/version.sh)"
 | 
						|
  if [ $DEBUG ]; then
 | 
						|
    go build -ldflags="$IMPRINT" -tags debug -v ./cmd/$CMD
 | 
						|
  else
 | 
						|
    go build -ldflags="$IMPRINT -s -w" -v ./cmd/$CMD
 | 
						|
  fi
 | 
						|
  if [ $UPX ]; then
 | 
						|
    upx --brute $CMD
 | 
						|
  fi
 | 
						|
done
 |