-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
374 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Function to check the last command for errors | ||
check_last_command() { | ||
if [ $? -ne 0 ]; then | ||
echo "An error occurred. Exiting." | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Step 0: Run the sh-stop-projects.sh script to stop all running ports | ||
echo "Ensuring templates/app/sh-stop-projects.sh is executable..." | ||
chmod +x templates/app/sh-stop-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/app/sh-stop-projects.sh to clean up..." | ||
(cd templates/app && sh sh-stop-projects.sh) | ||
check_last_command |
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,47 @@ | ||
#!/bin/bash | ||
|
||
# Function to check the last command for errors | ||
check_last_command() { | ||
if [ $? -ne 0 ]; then | ||
echo "An error occurred. Exiting." | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Step 0: Run the sh-cleanup-projects.sh script to clean up before creating the zip file | ||
echo "Ensuring templates/app/sh-cleanup-projects.sh is executable..." | ||
chmod +x templates/app/sh-cleanup-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/app/sh-cleanup-projects.sh to clean up..." | ||
(cd templates/app && sh sh-cleanup-projects.sh) | ||
check_last_command | ||
|
||
# Step 1: Run the sh-upgrade-projects.sh script to upgrade dependencies | ||
echo "Ensuring templates/app/sh-upgrade-projects.sh is executable..." | ||
chmod +x templates/app/sh-upgrade-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/app/sh-upgrade-projects.sh to upgrade dependencies..." | ||
(cd templates/app && sh sh-upgrade-projects.sh) | ||
check_last_command | ||
|
||
# Step 2: Run the sh-install-projects.sh script to install dependencies | ||
echo "Ensuring templates/app/sh-install-projects.sh is executable..." | ||
chmod +x templates/app/sh-install-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/app/sh-install-projects.sh to install dependencies..." | ||
(cd templates/app && sh sh-install-projects.sh) | ||
check_last_command | ||
|
||
# Step 3: Run the sh-start-projects.sh script to start the project | ||
echo "Ensuring templates/app/sh-start-projects.sh is executable..." | ||
chmod +x templates/app/sh-start-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/app/sh-start-projects.sh to start the project..." | ||
(cd templates/app && sh sh-start-projects.sh) | ||
check_last_command | ||
|
||
echo "All done!" |
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,18 @@ | ||
#!/bin/bash | ||
|
||
# Function to check the last command for errors | ||
check_last_command() { | ||
if [ $? -ne 0 ]; then | ||
echo "An error occurred. Exiting." | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Step 0: Run the sh-stop-projects.sh script to stop all running ports | ||
echo "Ensuring templates/library/sh-stop-projects.sh is executable..." | ||
chmod +x templates/library/sh-stop-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/library/sh-stop-projects.sh to clean up..." | ||
(cd templates/library && sh sh-stop-projects.sh) | ||
check_last_command |
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,47 @@ | ||
#!/bin/bash | ||
|
||
# Function to check the last command for errors | ||
check_last_command() { | ||
if [ $? -ne 0 ]; then | ||
echo "An error occurred. Exiting." | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Step 0: Run the sh-cleanup-projects.sh script to clean up before creating the zip file | ||
echo "Ensuring templates/library/sh-cleanup-projects.sh is executable..." | ||
chmod +x templates/library/sh-cleanup-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/library/sh-cleanup-projects.sh to clean up..." | ||
(cd templates/library && sh sh-cleanup-projects.sh) | ||
check_last_command | ||
|
||
# Step 1: Run the sh-upgrade-projects.sh script to upgrade dependencies | ||
echo "Ensuring templates/library/sh-upgrade-projects.sh is executable..." | ||
chmod +x templates/library/sh-upgrade-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/library/sh-upgrade-projects.sh to upgrade dependencies..." | ||
(cd templates/library && sh sh-upgrade-projects.sh) | ||
check_last_command | ||
|
||
# Step 2: Run the sh-install-projects.sh script to install dependencies | ||
echo "Ensuring templates/library/sh-install-projects.sh is executable..." | ||
chmod +x templates/library/sh-install-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/library/sh-install-projects.sh to install dependencies..." | ||
(cd templates/library && sh sh-install-projects.sh) | ||
check_last_command | ||
|
||
# Step 3: Run the sh-start-projects.sh script to start the project | ||
echo "Ensuring templates/library/sh-start-projects.sh is executable..." | ||
chmod +x templates/library/sh-start-projects.sh | ||
check_last_command | ||
|
||
echo "Running templates/library/sh-start-projects.sh to start the project..." | ||
(cd templates/library && sh sh-start-projects.sh) | ||
check_last_command | ||
|
||
echo "All done!" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,85 @@ | ||
#!/bin/bash | ||
|
||
# List of project directories | ||
projects=( | ||
"expressjs-library-boilerplate" | ||
"javascript-library-boilerplate" | ||
"nextjs-library-boilerplate" | ||
"nodejs-library-boilerplate" | ||
"react-native-library-boilerplate" | ||
"reactjs-library-boilerplate" | ||
) | ||
|
||
rm -rf react-native-library-boilerplate/example/node_modules | ||
|
||
# Loop through each project directory and remove specified files/folders | ||
for project in "${projects[@]}"; do | ||
echo "Cleaning up $project" | ||
|
||
# Define the zip file name | ||
zip_file="${project}.zip" | ||
|
||
# Check if the zip file exists and remove it | ||
if [ -f "$zip_file" ]; then | ||
echo "Removing existing zip file $zip_file" | ||
rm "$zip_file" | ||
else | ||
echo "No zip file found for $project" | ||
fi | ||
|
||
|
||
cd "$project" | ||
|
||
|
||
# Remove node_modules directory if it exists | ||
if [ -d node_modules ]; then | ||
echo "Removing node_modules from $project" | ||
rm -rf node_modules | ||
fi | ||
|
||
# Remove .next directory if it exists | ||
if [ -d .next ]; then | ||
echo "Removing .next from $project" | ||
rm -rf .next | ||
fi | ||
|
||
# Remove .next directory if it exists | ||
if [ -d .cache ]; then | ||
echo "Removing .cache from $project" | ||
rm -rf .cache | ||
fi | ||
|
||
# Remove .expo-shared directory if it exists | ||
if [ -d .expo-shared ]; then | ||
echo "Removing .expo-shared from $project" | ||
rm -rf .expo-shared | ||
fi | ||
|
||
# Remove .expo directory if it exists | ||
if [ -d .expo ]; then | ||
echo "Removing .expo from $project" | ||
rm -rf .expo | ||
fi | ||
|
||
# Remove yarn.lock file if it exists | ||
if [ -f yarn.lock ]; then | ||
echo "Removing yarn.lock from $project" | ||
rm yarn.lock | ||
fi | ||
|
||
# Go back to the parent directory | ||
cd .. | ||
done | ||
|
||
# Remove logs and pids directories if they exist | ||
if [ -d logs ]; then | ||
echo "Removing logs directory" | ||
rm -rf logs | ||
fi | ||
|
||
if [ -d pids ]; then | ||
echo "Removing pids directory" | ||
rm -rf pids | ||
fi | ||
|
||
echo "Cleanup completed for all projects." |
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,30 @@ | ||
#!/bin/bash | ||
|
||
# List of project directories | ||
projects=( | ||
"expressjs-library-boilerplate" | ||
"javascript-library-boilerplate" | ||
"nextjs-library-boilerplate" | ||
"nodejs-library-boilerplate" | ||
"react-native-library-boilerplate" | ||
"reactjs-library-boilerplate" | ||
) | ||
|
||
# Loop through each project directory and run yarn install | ||
for project in "${projects[@]}"; do | ||
echo "Installing dependencies in $project" | ||
cd "$project" | ||
|
||
# Check if package.json exists | ||
if [ -f package.json ]; then | ||
# Run yarn install | ||
yarn install | ||
else | ||
echo "package.json not found in $project" | ||
fi | ||
|
||
# Go back to the parent directory | ||
cd .. | ||
done | ||
|
||
echo "Dependencies have been installed for all projects." |
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,40 @@ | ||
#!/bin/bash | ||
|
||
# List of project directories | ||
projects=( | ||
"expressjs-library-boilerplate" | ||
"javascript-library-boilerplate" | ||
"nextjs-library-boilerplate" | ||
"nodejs-library-boilerplate" | ||
"react-native-library-boilerplate" | ||
"reactjs-library-boilerplate" | ||
) | ||
|
||
# Create logs and pids directories if they don't exist | ||
mkdir -p logs | ||
mkdir -p pids | ||
|
||
# Loop through each project directory and run yarn install | ||
for project in "${projects[@]}"; do | ||
echo "Starting project in $project" | ||
|
||
# Navigate to the project directory | ||
cd "$project" | ||
|
||
# Check if package.json exists | ||
if [ -f package.json ]; then | ||
# Run yarn dev and log output to a file | ||
(yarn dev > "../logs/$project.log" 2>&1 & echo $! > "../pids/$project.pid") | ||
echo "$project started, logging to ../logs/$project.log, PID saved to ../pids/$project.pid" | ||
else | ||
echo "package.json not found in $project" | ||
fi | ||
|
||
# Go back to the parent directory | ||
cd .. | ||
done | ||
|
||
# Wait for all background processes to finish | ||
wait | ||
|
||
echo "Dev servers have been started for all projects." |
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,31 @@ | ||
#!/bin/bash | ||
|
||
# List of project directories | ||
projects=( | ||
"expressjs-library-boilerplate" | ||
"javascript-library-boilerplate" | ||
"nextjs-library-boilerplate" | ||
"nodejs-library-boilerplate" | ||
"react-native-library-boilerplate" | ||
"reactjs-library-boilerplate" | ||
) | ||
|
||
# Loop through each project directory and stop the servers | ||
for project in "${projects[@]}"; do | ||
echo "Stopping project in $project" | ||
|
||
# Check if PID file exists | ||
if [ -f "pids/$project.pid" ]; then | ||
# Read the PID from the file and kill the process | ||
PID=$(cat "pids/$project.pid") | ||
kill $PID | ||
echo "$project stopped, PID $PID killed" | ||
|
||
# Remove the PID file | ||
rm "pids/$project.pid" | ||
else | ||
echo "PID file not found for $project" | ||
fi | ||
done | ||
|
||
echo "All dev servers have been stopped." |
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,30 @@ | ||
#!/bin/bash | ||
|
||
# List of project directories | ||
projects=( | ||
"expressjs-library-boilerplate" | ||
"javascript-library-boilerplate" | ||
"nextjs-library-boilerplate" | ||
"nodejs-library-boilerplate" | ||
"react-native-library-boilerplate" | ||
"reactjs-library-boilerplate" | ||
) | ||
|
||
# Loop through each project directory and run the upgrade command | ||
for project in "${projects[@]}"; do | ||
echo "Upgrading packages in $project" | ||
cd "$project" | ||
|
||
# Check if package.json exists | ||
if [ -f package.json ]; then | ||
# Run the upgrade command | ||
npm run upgrade | ||
else | ||
echo "package.json not found in $project" | ||
fi | ||
|
||
# Go back to the parent directory | ||
cd .. | ||
done | ||
|
||
echo "All projects have been upgraded." |
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,28 @@ | ||
#!/bin/bash | ||
|
||
# List of project directories | ||
projects=( | ||
"expressjs-library-boilerplate" | ||
"javascript-library-boilerplate" | ||
"nextjs-library-boilerplate" | ||
"nodejs-library-boilerplate" | ||
"react-native-library-boilerplate" | ||
"reactjs-library-boilerplate" | ||
) | ||
|
||
# Loop through each project directory to remove existing zip files and create new ones | ||
for project in "${projects[@]}"; do | ||
zip_file="${project}.zip" | ||
|
||
# Check if the zip file exists and remove it | ||
if [ -f "$zip_file" ]; then | ||
echo "Removing existing zip file $zip_file" | ||
rm "$zip_file" | ||
fi | ||
|
||
# Create a new zip file for the project directory | ||
echo "Creating zip file for $project" | ||
zip -r "$zip_file" "$project" | ||
done | ||
|
||
echo "Zip files have been created for all projects." |