0

I'm new to Mac OS, I have a .sh file that contains a few instructions to startup Laravel server, React Native Metro server, ngrok etc.

When I execute with :

bash /Users/username/Desktop/proyectos/wooloveapp.com/laravelapp/scripts/app-startup-mac.sh 

I get the following error:

The file /Users/gabriel/Desktop/proyectos/laravelapp.com/laravelappcom/scripts/cd /Users/gabriel/Desktop/proyectos/laravelapp.com && php artisan serve does not exist.
The file /Users/gabriel/Desktop/proyectos/laravelapp.com/laravelappcom/scripts/cd /Users/gabriel/Desktop/proyectos/laravelapp.com && php artisan db:drop && php artisan db:create && php artisan migrate --seed does not exist.
The file /Users/gabriel/Desktop/proyectos/laravelapp.com/laravelappcom/scripts/ngrok http 8000 does not exist.
The file /Users/gabriel/Desktop/proyectos/laravelapp.com/laravelappcom/scripts/cd /Users/gabriel/Desktop/proyectos/woo && cd android  && gradlew clean && cd .. && npx react-native run-android -- --reset-cache does not exist.
The file /Users/gabriel/Desktop/proyectos/laravelapp.com/laravelappcom/scripts/cd /Users/gabriel/Desktop/proyectos/laravelapp.com && php artisan websockets:serve does not exist.

My script is simple, the locations are exact, for each line I want to open a terminal and execute the following actions on that same terminal, is there anything I'm doing wrong?

My script:

#!/bin/bash

open -a Terminal "cd /Users/gabriel/Desktop/proyectos/laravelapp.com && php artisan serve"

open -a Terminal "cd /Users/gabriel/Desktop/proyectos/laravelapp.com && php artisan db:drop && php artisan db:create && php artisan migrate --seed"

open -a Terminal "ngrok http 8000"

open -a Terminal "cd /Users/gabriel/Desktop/proyectos/woo && cd android  && gradlew clean && cd .. && npx react-native run-android -- --reset-cache"

open -a Terminal "cd /Users/gabriel/Desktop/proyectos/laravelapp.com && php artisan websockets:serve"

gabogabans
  • 3,035
  • 5
  • 33
  • 81
  • ...as the linked duplicates say, you need to pass the name of a script that contains your command, not the command itself. It's unfortunate, but that's Apple; anything noninteractive is an afterthought. – Charles Duffy Jun 15 '23 at 16:49

0 Answers0