Feature: Ability to Pipe into `warden shell`
(/) Acceptance Criteria
-
warden shelldetects if contents are being piped into it -
warden shelltreats contents piped into it as if a -C flag had been passed -
warden shellby itself still launches a container
e.g. warden shell should act like bash
(?) Technical Information
if [[ -z "$value" && ! -t 0 ]]; then
while read -r piped; do
value+=$piped
done;
fi
Source: https://stackoverflow.com/a/37243826
Discussed in https://github.com/orgs/wardenenv/discussions/654
Originally posted by cjnewbs June 1, 2023
Hi,
I'm creating a makefile to setup local environments automatically.
I've got most of it working but I am having trouble running bin/magento s:up. I can run it interactively from within warden shell but I would like to be able to do something like:
echo "bin/magento s:up" | warden shell
Which is similar to running a setup SQL which I do like so:echo "$$SQL" | warden db import, however trying it with warden shell results in the error the input device is not a TTY
Any ides?
What's the benefit of this over just doing something like warden shell -c "bin/magento s:up"?
@bap14 Not much. The one benefit would be that it would work like people tend to expect
This does work warden env exec -T php-fpm bin/magento