chore: one-command script for nowfix CTA patch step 1 - #3
Conversation
Co-authored-by: Mohamed <garlobrian52@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Documented curl-pipe-to-bash usage will always fail
- The script now falls back to downloading the patch files and remote guide URLs when it is run from stdin, so the documented curl-pipe-to-bash flow works.
You can send follow-ups to the cloud agent here.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8999ca9. Configure here.
| #!/usr/bin/env bash | ||
| # Step 1: copy FixNow CTA patch files into your Next.js app root. | ||
| # Usage (from v0-linktree-clone-plan or any FixNow Next.js repo): | ||
| # curl -fsSL https://raw.githubusercontent.com/garlobrian52/github-mcp-server/main/scripts/apply-nowfix-cta-patch.sh | bash |
There was a problem hiding this comment.
Documented curl-pipe-to-bash usage will always fail
Medium Severity
The documented curl ... | bash usage on line 4 is incompatible with how SCRIPT_DIR is computed. When piped to bash, BASH_SOURCE[0] is empty or not a real file path, so dirname resolves to . (the caller's cwd), making PATCH point to a nonexistent ../docs/nowfix-cta-patch relative to the caller — which will always fail the existence check at line 14. The script can only work when executed as a file, not when piped.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8999ca9. Configure here.
There was a problem hiding this comment.
2 issues found across 1 file
Confidence score: 2/5
- High-confidence, high-severity issue in
scripts/apply-nowfix-cta-patch.sh: when run viacurl ... | bash,BASH_SOURCE[0]does not point to a local file, soPATCHresolves incorrectly and validation fails, which is a likely functional break for the script’s primary usage pattern. - There is also a validation gap in
scripts/apply-nowfix-cta-patch.sh: only one patch file is pre-checked, so missingapp/fixes/page.tsxorapp/fixes/[slug]/page.tsxleads to a genericcpfailure instead of a clear actionable message. - Pay close attention to
scripts/apply-nowfix-cta-patch.sh- path resolution and upfront validation need to be fixed to avoid broken execution and confusing errors.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/apply-nowfix-cta-patch.sh">
<violation number="1" location="scripts/apply-nowfix-cta-patch.sh:11">
P1: Curl-piped usage is broken — `BASH_SOURCE[0]` does not resolve to a local script path when piped to bash via stdin, so `PATCH` resolves to a non-existent local directory and the patch validation always fails. Remove the curl-pipe usage from the comments or redesign the script to fetch patch files remotely.</violation>
<violation number="2" location="scripts/apply-nowfix-cta-patch.sh:14">
P2: Only one of three patch files is validated upfront. If `app/fixes/page.tsx` or `app/fixes/[slug]/page.tsx` is missing, the user gets a generic `cp` error instead of a clear validation message. Check all three files before attempting copies.</violation>
</file>
Architecture diagram
sequenceDiagram
participant Dev as Developer Shell
participant Script as apply-nowfix-cta-patch.sh
participant Repo as FixNow Repo
participant PatchDir as docs/nowfix-cta-patch/
participant Target as Next.js App (e.g. v0-linktree-clone-plan)
Note over Dev,Target: Deploy Step 1: Copy CTA fix files into target Next.js app
Dev->>Script: Execute script (curl pipe or local)
Script->>Script: Resolve SCRIPT_DIR and PATCH path
Script->>PatchDir: Check lib/fixes.ts exists
alt Patch file missing
Script->>Dev: Error: "patch not found" & exit 1
end
Script->>Target: Check for package.json
alt Not a Next.js project
Script->>Dev: Error: "no package.json" & exit 1
end
Script->>Target: mkdir -p lib/ app/fixes/[slug]/
Script->>PatchDir: Read lib/fixes.ts
Script->>Target: Copy lib/fixes.ts
Script->>PatchDir: Read app/fixes/page.tsx
Script->>Target: Copy app/fixes/page.tsx
Script->>PatchDir: Read app/fixes/[slug]/page.tsx
Script->>Target: Copy app/fixes/[slug]/page.tsx
Script-->>Dev: Print list of copied files
Script-->>Dev: Output next steps from INTEGRATION.md
Note over Dev: Manual step: wire homepage + footer per docs
Note over Target,Dev: Future: replace href="#" with dynamic fixHref(fix.slug)
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| set -euo pipefail | ||
|
|
||
| TARGET="${1:-.}" | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
There was a problem hiding this comment.
P1: Curl-piped usage is broken — BASH_SOURCE[0] does not resolve to a local script path when piped to bash via stdin, so PATCH resolves to a non-existent local directory and the patch validation always fails. Remove the curl-pipe usage from the comments or redesign the script to fetch patch files remotely.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/apply-nowfix-cta-patch.sh, line 11:
<comment>Curl-piped usage is broken — `BASH_SOURCE[0]` does not resolve to a local script path when piped to bash via stdin, so `PATCH` resolves to a non-existent local directory and the patch validation always fails. Remove the curl-pipe usage from the comments or redesign the script to fetch patch files remotely.</comment>
<file context>
@@ -0,0 +1,38 @@
+set -euo pipefail
+
+TARGET="${1:-.}"
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+PATCH="${SCRIPT_DIR}/../docs/nowfix-cta-patch"
+
</file context>
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| PATCH="${SCRIPT_DIR}/../docs/nowfix-cta-patch" | ||
|
|
||
| if [[ ! -f "${PATCH}/lib/fixes.ts" ]]; then |
There was a problem hiding this comment.
P2: Only one of three patch files is validated upfront. If app/fixes/page.tsx or app/fixes/[slug]/page.tsx is missing, the user gets a generic cp error instead of a clear validation message. Check all three files before attempting copies.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/apply-nowfix-cta-patch.sh, line 14:
<comment>Only one of three patch files is validated upfront. If `app/fixes/page.tsx` or `app/fixes/[slug]/page.tsx` is missing, the user gets a generic `cp` error instead of a clear validation message. Check all three files before attempting copies.</comment>
<file context>
@@ -0,0 +1,38 @@
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+PATCH="${SCRIPT_DIR}/../docs/nowfix-cta-patch"
+
+if [[ ! -f "${PATCH}/lib/fixes.ts" ]]; then
+ echo "error: patch not found at ${PATCH}" >&2
+ exit 1
</file context>
| if [[ ! -f "${PATCH}/lib/fixes.ts" ]]; then | |
| if [[ ! -f "${PATCH}/lib/fixes.ts" ]] || [[ ! -f "${PATCH}/app/fixes/page.tsx" ]] || [[ ! -f "${PATCH}/app/fixes/[slug]/page.tsx" ]]; then |


Adds
scripts/apply-nowfix-cta-patch.shto copylib/fixes.tsandapp/fixes/**into a Next.js app (e.g.v0-linktree-clone-plan) as deploy step 1 for fixing placeholderhref="#"CTAs on nowfix.pro.Run from your FixNow repo root:
/path/to/github-mcp-server/scripts/apply-nowfix-cta-patch.sh .Then complete wiring per
docs/nowfix-cta-patch/INTEGRATION.md.Summary by cubic
Adds a one-command script to apply the CTA patch by copying FixNow routes into a Next.js app, replacing placeholder href="#" links. This delivers deploy step 1 for the nowfix.pro CTA fix.
Written for commit 8999ca9. Summary will update on new commits.