소스 검색

More portable hostname

Jakob Borg 11 년 전
부모
커밋
53cd877899
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      build.sh

+ 2 - 1
build.sh

@@ -6,7 +6,8 @@ distFiles=(README.md LICENSE) # apart from the binary itself
 version=$(git describe --always --dirty)
 date=$(date +%s)
 user=$(whoami)
-host=$(hostname -s)
+host=$(hostname)
+host=${host%%.*}
 ldflags="-w -X main.Version $version -X main.BuildStamp $date -X main.BuildUser $user -X main.BuildHost $host"
 
 build() {