Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kitstack committed Jun 17, 2023
1 parent 93e8656 commit 5c97acd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
16 changes: 1 addition & 15 deletions githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
#!/bin/sh

staticcheck ./...

package=$(basename "$(pwd)")
packageVersion=$(git describe --tags --abbrev=0 || echo "0.0.0")
packageCommit=$(git rev-parse --short HEAD || echo "")

cat <<EOF > manifest.go
package $package
var packageName = "$package"
var packageVersion = "$packageVersion"
var packageCommit = "$packageCommit"
EOF

exec git add manifest.go
staticcheck ./...
17 changes: 16 additions & 1 deletion githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,19 @@ coverage=$(go test ./... --cover | awk '/coverage:/ ' | awk '{if ($1 != "?") pr
if [[ $coverage != "100.00" ]]; then
echo "Error: global coverage is $coverage%, it should be 100.00%."
exit 1
fi
fi

package=$(basename "$(pwd)")
packageVersion=$(basename "$1" --suffix "/")
packageCommit=$(git rev-parse --short HEAD || echo "")

cat <<EOF > manifest.go
package $package
var packageName = "$package"
var packageVersion = "$packageVersion"
var packageCommit = "$packageCommit"
EOF

git add manifest.go
git commit -m "Version ${_VERSION} : automatic version"

0 comments on commit 5c97acd

Please sign in to comment.