Skip to content

Commit dc592eb

Browse files
update local flavor
1 parent d9fddba commit dc592eb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/local-circ.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# Updates build.gradle.kts with local IP and UUID from database
3+
4+
GRADLE_FILE="../simplified-app-ekirjasto/build.gradle.kts"
5+
6+
# Get IP and UUID for MACOS
7+
LOCAL_IP=$(ipconfig getifaddr en0)
8+
UUID=$(psql -U palace -h localhost -d circ -c "SELECT UUID FROM public.libraries ORDER BY id ASC" -t | xargs)
9+
10+
# Update first occurrences with proper indentation (macOS sed)
11+
sed -i '' "1,/val circURL/s/val circURL.*/\t\t\tval circURL = \"$LOCAL_IP\"/" "$GRADLE_FILE"
12+
sed -i '' "1,/val libProvider/s/val libProvider.*/\t\t\tval libProvider = \"$UUID\"/" "$GRADLE_FILE"
13+
14+
echo "Updated IP: $LOCAL_IP"
15+
echo "Updated UUID: $UUID"

0 commit comments

Comments
 (0)