added --run flag
This commit is contained in:
parent
a8a5afc932
commit
37e78912e7
1 changed files with 20 additions and 1 deletions
21
builder.sh
21
builder.sh
|
@ -66,6 +66,13 @@ configure_and_build() {
|
|||
./mach build || { echo "Build failed. Exiting."; exit 1; }
|
||||
}
|
||||
|
||||
# Function to run the project after build
|
||||
run_project() {
|
||||
echo "Running the project..."
|
||||
cd "$SOURCE_PATH" || { echo "Failed to navigate to browser directory. Exiting."; exit 1; }
|
||||
./mach run || { echo "Failed to run the project. Exiting."; exit 1; }
|
||||
}
|
||||
|
||||
# Function to print usage instructions
|
||||
print_help() {
|
||||
echo "Usage: ./builder.sh [options]"
|
||||
|
@ -75,6 +82,7 @@ print_help() {
|
|||
echo " -c, --clean : Clean build"
|
||||
echo " -u, --update : Update Mozilla repository"
|
||||
echo " -p, --patches : Update patches"
|
||||
echo " -r, --run : Run the project after build using mach run in the browser directory"
|
||||
echo " -h, --help : Display this help message"
|
||||
exit 1
|
||||
}
|
||||
|
@ -98,6 +106,9 @@ while [[ $# -gt 0 ]]; do
|
|||
-p|--patches)
|
||||
patches=true
|
||||
;;
|
||||
-r|--run)
|
||||
run=true
|
||||
;;
|
||||
-h|--help)
|
||||
print_help
|
||||
;;
|
||||
|
@ -117,9 +128,15 @@ if [ "$all" = true ]; then
|
|||
update_repo
|
||||
update_patches
|
||||
configure_and_build
|
||||
if [ "$run" = true ]; then
|
||||
run_project
|
||||
fi
|
||||
echo "Spitfire build completed successfully."
|
||||
if [ "$build" = true ]; then
|
||||
elif [ "$build" = true ]; then
|
||||
configure_and_build
|
||||
if [ "$run" = true ]; then
|
||||
run_project
|
||||
fi
|
||||
echo "Spitfire build completed successfully."
|
||||
elif [ "$clean" = true ]; then
|
||||
clean_build
|
||||
|
@ -132,6 +149,8 @@ elif [ "$patches" = true ]; then
|
|||
download_source
|
||||
update_patches
|
||||
echo "Patches updated."
|
||||
elif [ "$run" = true ]; then
|
||||
run_project
|
||||
else
|
||||
print_help
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue