Module

x/license_checker/s

📄 CLI tool for checking license headers in files
Go to Latest
File
#!/bin/shset -euPJ=saku
# get the version tag from $PJ.mdVERSION=$(sed -e 's/^.*'$PJ' *v*\([0-9]*\.[0-9]*\.[0-9]\).*$/\1/p;d' < $PJ.md)TAG=v$VERSIONVERSION_DIR=$HOME/.$PJ/$TAGEXE=$VERSION_DIR/$PJ
# Download it if the binary doesn't exist.if [ ! -e "$EXE" ]; then echo "Downloading the $PJ binary (version $VERSION)" TEMP=$(mktemp -d) curl -fsSL https://github.com/kt3k/"$PJ"/releases/download/"$TAG"/${PJ}_"$VERSION"_"$(uname | tr '[:upper:]' '[:lower:]')"_amd64.tar.gz -o "$TEMP"/bin.tgz echo "Extracting the $PJ binary" mkdir -p "$VERSION_DIR" # gunzip ... tar -C "$VERSION_DIR" -xf "$TEMP"/bin.tgz "$PJ" rm -rf "$TEMP" chmod +x "$EXE"fi
echo "Use $EXE"
# Run $PJ$EXE "$@"