Edd .editorconfig for *.sh and format shell scripts

This commit is contained in:
Matias Fontanini 2023-12-08 16:13:57 -08:00
parent d7dc027769
commit d329243637
3 changed files with 15 additions and 16 deletions

3
.editorconfig Normal file
View File

@ -0,0 +1,3 @@
[*.sh]
indent_style = space
indent_size = 4

View File

@ -2,10 +2,9 @@
set -e
if [ $# -ne 1 ]
then
echo "Usage: $0 <bat-git-hash>"
exit 1
if [ $# -ne 1 ]; then
echo "Usage: $0 <bat-git-hash>"
exit 1
fi
script_path=$(realpath "$0")
@ -23,8 +22,7 @@ cp assets/themes.bin "$script_dir"
acknowledgements_file="$script_dir/acknowledgements.txt"
cp LICENSE-MIT "$acknowledgements_file"
zlib-flate -uncompress < assets/acknowledgements.bin >> "$acknowledgements_file"
echo "$git_hash" > "$script_dir/bat.git-hash"
zlib-flate -uncompress <assets/acknowledgements.bin >>"$acknowledgements_file"
echo "$git_hash" >"$script_dir/bat.git-hash"
echo "syntaxes/themes updated"

View File

@ -12,15 +12,13 @@ git clone https://github.com/sharkdp/bat.git "$clone_path"
cd "$clone_path"
git reset --hard "$git_hash"
for file in syntaxes.bin themes.bin
do
our_hash=$(sha256sum "$script_dir/$file" | cut -d " " -f1)
their_hash=$(sha256sum "$clone_path/assets/$file" | cut -d " " -f 1)
if [ "$our_hash" != "$their_hash" ]
then
echo "Unexpected hash for ${file}: should be ${their_hash}, is ${our_hash}"
exit 1
fi
for file in syntaxes.bin themes.bin; do
our_hash=$(sha256sum "$script_dir/$file" | cut -d " " -f1)
their_hash=$(sha256sum "$clone_path/assets/$file" | cut -d " " -f 1)
if [ "$our_hash" != "$their_hash" ]; then
echo "Unexpected hash for ${file}: should be ${their_hash}, is ${our_hash}"
exit 1
fi
done
echo "All hashes match"