Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Ability to Pipe into warden shell #662

Open
navarr opened this issue Jun 19, 2023 Discussed in #654 · 3 comments
Open

Feature: Ability to Pipe into warden shell #662

navarr opened this issue Jun 19, 2023 Discussed in #654 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@navarr
Copy link
Member

navarr commented Jun 19, 2023

(/) Acceptance Criteria

  • warden shell detects if contents are being piped into it
  • warden shell treats contents piped into it as if a -C flag had been passed
  • warden shell by 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?

@navarr navarr added the enhancement New feature or request label Jun 19, 2023
@navarr navarr added this to the Warden 1.0.0 milestone Jun 19, 2023
@bap14
Copy link
Contributor

bap14 commented Jul 30, 2023

What's the benefit of this over just doing something like warden shell -c "bin/magento s:up"?

@navarr
Copy link
Member Author

navarr commented Jul 31, 2023

@bap14 Not much. The one benefit would be that it would work like people tend to expect

@fooman
Copy link
Contributor

fooman commented Aug 3, 2023

This does work warden env exec -T php-fpm bin/magento

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants