#!/usr/bin/env bash set -e # Default output path OUTPUT_PATH="${HOME}/.deno/bin/pmpr" # Ensure directory exists mkdir -p "$(dirname "$OUTPUT_PATH")" # Check if we are on a system that needs patching (like NixOS) IS_NIXOS=false if [ "$(uname)" = "Linux" ]; then if [ ! -f /lib64/ld-linux-x86-64.so.2 ] || ls -l /lib64/ld-linux-x86-64.so.2 | grep -q "stub-ld"; then IS_NIXOS=true fi fi if [ "$IS_NIXOS" = true ]; then echo "NixOS detected. Creating a wrapper script instead of a compiled binary to avoid linking issues with Deno." # Use absolute paths for config and script to make it work from anywhere PROJECT_ROOT="$(pwd)" cat > "$OUTPUT_PATH" <