ripgrep_linux_loong64.sh 645 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. # When installing @vscode/ripgrep, it will try to download prebuilt ripgrep binary from https://github.com/microsoft/ripgrep-prebuilt,
  3. # however, loong64 is not a supported architecture and x86 will be picked as fallback, so we need to replace it with a native one.
  4. if [ "$#" -ne 1 ]; then
  5. echo "Usage: $0 <path_to_node_modules>"
  6. exit 1
  7. fi
  8. RG_PATH="$1/@vscode/ripgrep/bin/rg"
  9. RG_VERSION="14.1.1"
  10. echo "Replacing ripgrep binary with loong64 one"
  11. rm "${RG_PATH}"
  12. curl --silent --fail -L https://github.com/darkyzhou/ripgrep-loongarch64-musl/releases/download/${RG_VERSION}/rg -o "${RG_PATH}"
  13. chmod +x "${RG_PATH}"