Skip to content

Commit 1dd337b

Browse files
committed
fix: gqm build error
1 parent 629123c commit 1dd337b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

scripts/gqm_gen/update_gqm.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
set -euo pipefail
44

5-
# Ensure measuring directory exists
6-
mkdir -p measuring
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
7+
8+
# Ensure measuring directory exists at repo root (TS writes ../../measuring/use_gqm.md)
9+
mkdir -p "$REPO_ROOT/measuring"
710

811
# Create use_gqm.md if it doesn't exist
9-
if [ ! -f measuring/use_gqm.md ]; then
10-
cat > measuring/use_gqm.md << 'EOF'
12+
if [ ! -f "$REPO_ROOT/measuring/use_gqm.md" ]; then
13+
cat > "$REPO_ROOT/measuring/use_gqm.md" << 'EOF'
1114
# Goals, Questions, Metrics
1215
1316
```mermaid
@@ -16,7 +19,8 @@ graph LR;
1619
EOF
1720
fi
1821

19-
# Run the TypeScript code
22+
# Run the TypeScript code (package.json lives here)
23+
cd "$SCRIPT_DIR"
2024
npm install
2125
npm run start || true # Continue even if tests fail
2226

@@ -25,6 +29,7 @@ if [ "${ACT:-}" = "true" ]; then
2529
echo "Running in act - simulating successful git operations"
2630
exit 0
2731
else
32+
cd "$REPO_ROOT"
2833
git add measuring/use_gqm.md
2934
git diff --staged --quiet || (git commit -m "Update Goals Questions Metrics Graph" && git push origin "HEAD:${GITHUB_REF}")
30-
fi
35+
fi

0 commit comments

Comments
 (0)