Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Improve head command portability
Browse files Browse the repository at this point in the history
* head -count is obsolete syntax, switched to -n count
* head -c is not portable, better use dd which works everywhere

Signed-off-by: bzp99 <[email protected]>
  • Loading branch information
bzp99 authored and Casey Kuhlman committed Mar 16, 2021
1 parent 5c4f052 commit 55661e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/commit_hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
commit=$(git describe --tags)
dirty=$(git ls-files -m)
if [[ -n ${dirty} ]]; then
commit="$commit+dirty.$(echo ${dirty} | git hash-object --stdin | head -c8)"
commit="$commit+dirty.$(echo ${dirty} | git hash-object --stdin | dd bs=8 count=1 status=none)"
fi
echo "$commit"

2 changes: 1 addition & 1 deletion tests/dump/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ echo -e "${title//?/-}\n${title}\n${title//?/-}\n"

$burrow_bin dump remote -b dump.bin
$burrow_bin dump remote dump.json
height=$(head -1 dump.json | jq .Height)
height=$(head -n 1 dump.json | jq .Height)

kill $burrow_pid

Expand Down

0 comments on commit 55661e6

Please sign in to comment.