Skip to content

chore: one-command script for nowfix CTA patch step 1 - #3

Merged
garlobrian52 merged 1 commit into
mainfrom
Th_Blueprintapply-nowfix-step1-f16c
Jun 1, 2026
Merged

chore: one-command script for nowfix CTA patch step 1#3
garlobrian52 merged 1 commit into
mainfrom
Th_Blueprintapply-nowfix-step1-f16c

Conversation

@garlobrian52

@garlobrian52 garlobrian52 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Adds scripts/apply-nowfix-cta-patch.sh to copy lib/fixes.ts and app/fixes/** into a Next.js app (e.g. v0-linktree-clone-plan) as deploy step 1 for fixing placeholder href="#" 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.

Open in Web Open in Cursor 

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.

  • New Features
    • Added scripts/apply-nowfix-cta-patch.sh to copy lib/fixes.ts and app/fixes/** into a target Next.js app.
    • Validates patch files and target project (checks package.json) with clear errors.
    • Supports curl piping or local execution with a target path.
    • Outputs next steps and points to docs/nowfix-cta-patch/INTEGRATION.md.

Written for commit 8999ca9. Summary will update on new commits.

Review in cubic

Co-authored-by: Mohamed  <garlobrian52@users.noreply.github.com>
@semanticdiff-com

Copy link
Copy Markdown

Review changes with  SemanticDiff

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-quick-tech-fixes Ready Ready Preview, Comment, Open in v0 Jun 1, 2026 5:30am

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8999ca9. Configure here.

@garlobrian52
garlobrian52 marked this pull request as ready for review June 1, 2026 05:33
@garlobrian52
garlobrian52 merged commit 4c27857 into main Jun 1, 2026
6 checks passed

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 1 file

Confidence score: 2/5

  • High-confidence, high-severity issue in scripts/apply-nowfix-cta-patch.sh: when run via curl ... | bash, BASH_SOURCE[0] does not point to a local file, so PATCH resolves 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 missing app/fixes/page.tsx or app/fixes/[slug]/page.tsx leads to a generic cp failure 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)
Loading

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)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants