Skip to content

Commit

Permalink
reduce binary detection size from 2MB to 1MB (rust binaries)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpillora authored Nov 9, 2020
1 parent 5b7f069 commit 79ed9be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ function install {
#search subtree largest file (bin)
TMP_BIN=$(find . -type f | xargs du | sort -n | tail -n 1 | cut -f 2)
if [ ! -f "$TMP_BIN" ]; then
fail "could not find downloaded binary"
fail "could not find find binary (largest file)"
fi
#ensure its larger than 2MB
#ensure its larger than 1MB
if [[ $(du -m $TMP_BIN | cut -f1) -lt 2 ]]; then
fail "resulting file is smaller than 2MB, not a go binary"
fail "no binary found ($TMP_BIN is not larger than 1MB)"
fi
#move into PATH or cwd
chmod +x $TMP_BIN || fail "chmod +x failed"
Expand Down
8 changes: 5 additions & 3 deletions scripts/statik.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 79ed9be

Please sign in to comment.