-
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.
Merge pull request #52 from degica/dev
Dev
- Loading branch information
Showing
19 changed files
with
357 additions
and
26 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
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,61 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
PLATFORM=${1:-} | ||
|
||
# Function to fetch the version from the package.json using Node.js | ||
get_package_version() { | ||
node -p "require('../payment_sdk/package.json').version" | ||
} | ||
|
||
# Function to terminate Metro | ||
terminate_metro() { | ||
if pgrep -f "node.*metro" > /dev/null; then | ||
echo "Terminating Metro server..." | ||
pkill -f "node.*metro" | ||
else | ||
echo "Metro server is not running." | ||
fi | ||
} | ||
|
||
# Uninstall the package from example | ||
echo "Uninstalling @komoju/komoju-react-native from example" | ||
npm uninstall @komoju/komoju-react-native | ||
|
||
# Change directory to payment_sdk | ||
echo "Changing directory to payment_sdk" | ||
cd ../payment_sdk | ||
|
||
# Build the package | ||
echo "Building the package" | ||
npm run build | ||
|
||
# Get the version from package.json | ||
PACKAGE_VERSION=$(get_package_version) | ||
echo "Package version found: $PACKAGE_VERSION" | ||
|
||
# Change directory back to example | ||
echo "Changing directory back to example" | ||
cd ../example | ||
|
||
# Install the built package | ||
echo "Installing the built package version $PACKAGE_VERSION" | ||
npm i "../payment_sdk/komoju-komoju-react-native-${PACKAGE_VERSION}.tgz" | ||
|
||
# Terminate Metro | ||
terminate_metro | ||
|
||
# Run platform-specific command if provided | ||
case $PLATFORM in | ||
android) | ||
echo "Running on Android" | ||
react-native run-android | ||
;; | ||
ios) | ||
echo "Running on iOS" | ||
react-native run-ios | ||
;; | ||
esac | ||
|
||
echo "Installation and build process complete!" |
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,20 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# Function to terminate Metro | ||
terminate_metro() { | ||
if pgrep -f "node.*metro" > /dev/null; then | ||
echo "Terminating Metro server..." | ||
pkill -f "node.*metro" | ||
else | ||
echo "Metro server is not running." | ||
fi | ||
} | ||
|
||
# Terminate any running Metro server | ||
terminate_metro | ||
|
||
# Start the Metro server with cache clean | ||
echo "Starting Metro server with cache clean" | ||
npx react-native start --reset-cache |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.