Skip to content

Commit

Permalink
fix shellcheck lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou committed Feb 17, 2024
1 parent caa4dfe commit f113e0c
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions mktypes.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
#!/bin/sh

PKGS="cpu disk docker host load mem net process"
PKGS="cpu disk docker host load mem net process sensors winservices"

GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
GOARCH=$(go env GOARCH)

for DIR in .
for PKG in $PKGS
do
(cd "$DIR" || exit
for PKG in $PKGS
do
if [ -e "${PKG}/types_${GOOS}.go" ]; then
(echo "// +build $GOOS"
echo "// +build $GOARCH"
go tool cgo -godefs "${PKG}/types_${GOOS}.go") | gofmt > "${PKG}/${PKG}_${GOOS}_${GOARCH}.go"
fi
done)
if [ -e "${PKG}/types_${GOOS}.go" ]; then
(echo "// +build $GOOS"
echo "// +build $GOARCH"
go tool cgo -godefs "${PKG}/types_${GOOS}.go") | gofmt > "${PKG}/${PKG}_${GOOS}_${GOARCH}.go"
fi
done

0 comments on commit f113e0c

Please sign in to comment.