We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9fddba commit dc592ebCopy full SHA for dc592eb
scripts/local-circ.sh
@@ -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