Skip to content

Commit 7713f85

Browse files
committed
Fix hardcoded values, status resolver, macOS grep, and corrupted image refs
- Replace hardcoded SERVER/REMOTE_REPO with ENV_SERVER/ENV_REMOTE_REPO env vars in push-env-key.sh - Fix status_to_gid() to accept both names and GIDs, with explicit error for unknown values - Replace grep -oP (Perl regex) with sed for macOS compatibility in pr-watch.sh - Remove corrupted image references from typescript-standards precompute-outside-loops example
1 parent c27bfc4 commit 7713f85

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

.cursor/rules/typescript-standards.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Exception: Empty handlers are acceptable ONLY when the rejection is an expected
7373
<standard id="extract-helpers">Extract reusable helpers for common boilerplate patterns (e.g., "run at most once in parallel").</standard>
7474

7575
<standard id="precompute-outside-loops">Avoid calling expensive transformation functions (like `normalizeForSearch`, `toLowerCase`) inside loops when the input doesn't change per iteration. Pre-compute outside the loop.
76-
❌ `items.filter(item => searchTerms.every(term => normalize(item![1770928879881](image/typescript-standards/1770928879881.png)![1770928886532](image/typescript-standards/1770928886532.png).name).includes(term)))`
76+
❌ `items.filter(item => searchTerms.every(term => normalize(item.name).includes(term)))`
7777
✅ `items.filter(item => { const n = normalize(item.name); return searchTerms.every(term => n.includes(term)) })`
7878
</standard>
7979

.cursor/scripts/pr-watch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ while true; do
6464
NOW=$(date '+%H:%M:%S')
6565

6666
# Parse recommended interval from script output
67-
RECOMMENDED=$(echo "$OUTPUT" | grep -oP '(?<=^# interval:)\d+' || echo "")
67+
RECOMMENDED=$(echo "$OUTPUT" | sed -n 's/^# interval:\([0-9]\+\)/\1/p' | head -n 1)
6868

6969
# Determine actual sleep interval
7070
if [[ -n "$INTERVAL" ]]; then

.cursor/scripts/push-env-key.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,25 @@
66
# Examples:
77
# push-env-key.sh EDGE_API_KEY abc123
88
# push-env-key.sh EDGE_API_KEY abc123 -m "Rotate Edge API key"
9+
#
10+
# Requires env vars:
11+
# ENV_SERVER: SSH hostname for the remote server
12+
# ENV_REMOTE_REPO: Path to the remote repository
913

1014
set -euo pipefail
1115

12-
SERVER="jack"
13-
REMOTE_REPO="/home/jon/jenkins-files/master"
16+
if [[ -z "${ENV_SERVER:-}" ]]; then
17+
echo "Error: ENV_SERVER not set" >&2
18+
exit 1
19+
fi
20+
21+
if [[ -z "${ENV_REMOTE_REPO:-}" ]]; then
22+
echo "Error: ENV_REMOTE_REPO not set" >&2
23+
exit 1
24+
fi
25+
26+
SERVER="$ENV_SERVER"
27+
REMOTE_REPO="$ENV_REMOTE_REPO"
1428

1529
KEY=""
1630
VALUE=""

.cursor/skills/asana-task-update/scripts/asana-task-update.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ status_to_gid() {
9090
"Review Needed") echo "$REVIEW_NEEDED_OPTION" ;;
9191
"Publish Needed") echo "$PUBLISH_NEEDED_OPTION" ;;
9292
"Verification Needed") echo "$VERIFICATION_NEEDED_OPTION" ;;
93-
*) echo "$1" ;;
93+
"$REVIEW_NEEDED_OPTION"|"$PUBLISH_NEEDED_OPTION"|"$VERIFICATION_NEEDED_OPTION") echo "$1" ;;
94+
*) echo "Error: Unknown status '$1' (expected name or GID)" >&2; exit 1 ;;
9495
esac
9596
}
9697

0 commit comments

Comments
 (0)