#!/bin/sh case "$(arch)" in x86_64) _archname="x64" ;; aarch64) _archname="arm64" ;; armv7h) _archname="armv7l" ;; ppc64le) _archname="ppc64le" ;; s390x) _archname="s390x" ;; *) echo "arch name not recognized" exit 1 ;; esac echo "$_archname" hashversion="$(wget -o /dev/null -O- https://nodejs.org/download/release/latest-v22.x/SHASUMS256.txt | grep linux-$_archname.tar.xz | sed "s!node-v!!;s!-linux-$_archname.tar.xz!!")" version="$(echo $hashversion | cut -d ' ' -f 2)" echo "$version" hash="$(echo $hashversion | cut -d ' ' -f 1)" echo "$hash" sed -i "s!pkgver=.*!pkgver=\"$version\"!;s!sha256sums=.*!sha256sums=\(\'$hash\'\)!" PKGBUILD