statamic / cli

Install and manage your Statamic projects from the command line.
71 stars 19 forks source link

Don't enable tty if `no-interaction` option is true #66

Open amiuhle opened 10 months ago

amiuhle commented 10 months ago

Fixes #65

amiuhle commented 10 months ago

I found a way to simulate #65 without a docker container:

Give a debug.sh like below, it's possible to simulate this behaviour with true | (setsid ./debug.sh) 2>&1 | cat

# debug.sh
# https://superuser.com/questions/1430872/how-to-simulate-a-shell-without-tty
# true | (setsid ./debug.sh) 2>&1 | cat
bin/statamic new -n -f -- test01

This fails on master with the error message described above, my PR should fix it.

I also fixed an error caused by --no-ansi being prepended to rm commands, so I added a filter. I could create a helper function to DRY up the code a bit, if you want me to open a separate PR for this, please let me know.