Run shell scripts through shfmt

This commit is contained in:
2026-01-17 16:30:55 -06:00
parent 8a7682e953
commit 350bf7c865

34
sync.sh
View File

@@ -13,22 +13,22 @@ source "$DIR/framework/versions"
node_installed_checksum_file="$DIR/framework/binaries/.node.checksum" node_installed_checksum_file="$DIR/framework/binaries/.node.checksum"
node_installed_checksum="" node_installed_checksum=""
if [ -f "$node_installed_checksum_file" ]; then if [ -f "$node_installed_checksum_file" ]; then
node_installed_checksum=$(cat "$node_installed_checksum_file") node_installed_checksum=$(cat "$node_installed_checksum_file")
fi fi
if [ "$node_installed_checksum" != "$nodejs_checksum_linux_x86_64" ]; then if [ "$node_installed_checksum" != "$nodejs_checksum_linux_x86_64" ]; then
echo "Downloading Node.js..." echo "Downloading Node.js..."
node_archive="$DIR/framework/downloads/node.tar.xz" node_archive="$DIR/framework/downloads/node.tar.xz"
curl -fsSL "$nodejs_binary_linux_x86_64" -o "$node_archive" curl -fsSL "$nodejs_binary_linux_x86_64" -o "$node_archive"
echo "Verifying checksum..." echo "Verifying checksum..."
echo "$nodejs_checksum_linux_x86_64 $node_archive" | sha256sum -c - echo "$nodejs_checksum_linux_x86_64 $node_archive" | sha256sum -c -
echo "Extracting Node.js..." echo "Extracting Node.js..."
tar -xf "$node_archive" -C "$DIR/framework/binaries" tar -xf "$node_archive" -C "$DIR/framework/binaries"
rm "$node_archive" rm "$node_archive"
echo "$nodejs_checksum_linux_x86_64" >"$node_installed_checksum_file" echo "$nodejs_checksum_linux_x86_64" >"$node_installed_checksum_file"
fi fi
# Ensure correct pnpm version is installed # Ensure correct pnpm version is installed
@@ -36,22 +36,22 @@ pnpm_binary="$DIR/framework/binaries/pnpm"
pnpm_installed_checksum_file="$DIR/framework/binaries/.pnpm.checksum" pnpm_installed_checksum_file="$DIR/framework/binaries/.pnpm.checksum"
pnpm_installed_checksum="" pnpm_installed_checksum=""
if [ -f "$pnpm_installed_checksum_file" ]; then if [ -f "$pnpm_installed_checksum_file" ]; then
pnpm_installed_checksum=$(cat "$pnpm_installed_checksum_file") pnpm_installed_checksum=$(cat "$pnpm_installed_checksum_file")
fi fi
# pnpm checksum includes "sha256:" prefix, strip it for sha256sum # pnpm checksum includes "sha256:" prefix, strip it for sha256sum
pnpm_checksum="${pnpm_checksum_linux_x86_64#sha256:}" pnpm_checksum="${pnpm_checksum_linux_x86_64#sha256:}"
if [ "$pnpm_installed_checksum" != "$pnpm_checksum" ]; then if [ "$pnpm_installed_checksum" != "$pnpm_checksum" ]; then
echo "Downloading pnpm..." echo "Downloading pnpm..."
curl -fsSL "$pnpm_binary_linux_x86_64" -o "$pnpm_binary" curl -fsSL "$pnpm_binary_linux_x86_64" -o "$pnpm_binary"
echo "Verifying checksum..." echo "Verifying checksum..."
echo "$pnpm_checksum $pnpm_binary" | sha256sum -c - echo "$pnpm_checksum $pnpm_binary" | sha256sum -c -
chmod +x "$pnpm_binary" chmod +x "$pnpm_binary"
echo "$pnpm_checksum" >"$pnpm_installed_checksum_file" echo "$pnpm_checksum" >"$pnpm_installed_checksum_file"
fi fi
# Get golang binaries in place # Get golang binaries in place