-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core(scripts): automated api url fetch + improved animation (#63)
- Loading branch information
1 parent
4701386
commit 5893f20
Showing
7 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ yarn-error.* | |
|
||
# typescript | ||
*.tsbuildinfo | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
module.exports = function (api) { | ||
api.cache(true); | ||
return { | ||
presets: ["babel-preset-expo",], | ||
presets: ["babel-preset-expo"], | ||
plugins: [ | ||
"nativewind/babel", | ||
"react-native-reanimated/plugin" | ||
"react-native-reanimated/plugin", | ||
[ | ||
"module:react-native-dotenv", | ||
{ | ||
moduleName: "@env", | ||
path: ".env", | ||
safe: true, | ||
allowUndefined: true, | ||
}, | ||
], | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
echo "Fetching the current IP address..." | ||
|
||
# Get the IP address of the first interface found. | ||
IP_ADDRESS=$(ipconfig getifaddr en0) | ||
|
||
# Fallback in case en0 is not available (use Wi-Fi interface) | ||
if [ -z "$IP_ADDRESS" ]; then | ||
IP_ADDRESS=$(ipconfig getifaddr en1) | ||
fi | ||
|
||
if [ -z "$IP_ADDRESS" ]; then | ||
echo "Error: IP address could not be found." | ||
exit 1 | ||
fi | ||
|
||
echo -n "Updating the API URL in .env file... " | ||
|
||
# Create or overwrite the .env file with the IP_ADDRESS | ||
echo "API_BASE_URL=http://$IP_ADDRESS:3000" > .env | ||
|
||
echo "Done." | ||
|
||
# Add additional environment variables as needed | ||
|
||
echo "API URL successfully updated to http://$IP_ADDRESS:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters