kareman/SwiftShell

running a shell script

patchthecode opened this issue · 4 comments

Is it possible to run a shell script with this library?

I tried this -> run("/Users/Shared/.apex/temp/update.sh")

but I was getting a Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Couldn't posix_spawn: error 8'

I looked around on stack overflow and it seems like something with setting the launch path? -> https://stackoverflow.com/questions/25559608/running-shell-script-with-nstask-causes-posix-spawn-error

I was wondering if i was missing something?

Thanks so much man!
I had one last query: Is it possible to run a shell command that is separate from the app?
As in, even if the launched app closes, the spawned shell process will continue running?

I am trying to create App1 where the spawns an updaterApp. App1 will then close itself. And the updater will update its files. After updating is complete, updaterApp will then relaunch the new App1.

If it is not possible then its ok, I will try to find workarounds.

thanks