Closed scq closed 2 months ago
I've been using it locally for a while and discovered some issues with handling of args recently, will just convert it to a draft until I fix those
I've been using it locally for a while and discovered some issues with handling of args recently, will just convert it to a draft until I fix those
Hey @scq how far are you away from converting this back to a regular merge request and get it in? Would be a great addition.
@derschatta I still need to solve the issue with passing arguments -- it will fail if it gets passed arguments that are too complex. I'll try and take a look at this again to get that working :D
Fixed the issues. Bash is currently broken though, so it needs #282 first.
Things you can do:
tphp
-- start your preferred shell in the php container (make sure to set INTERACTIVE_SHELL in .env)tphp ls
-- run arbitrary commands in the php containertphp install
-- run sh aliasestphp dev/approval/simple/create_demo.php
-- run php scriptstphp server/admin/tool/task/cli/schedule_task.php --execute='\tool_diagnostic\task\delete_diagnostic_files_task'
-- run complex commandsIt autodetects if the first argument ends in .php and adds php
on to the beginning, because I found that I kept leaving it off (and tphp php ...
looks a little weird)
Changed INTERACTIVE_SHELL
default to zsh
, seems like hardly anybody is using bash
given #282
There must be something specific needed for MacOS as I get:
/Users/username/folder/totara/docker/bin/tphp: line 13: ${i@Q}: bad substitution
when I try to use the command.
Oh weird. I think Apple ships an ancient bash version that doesn't seem to support that parameter expansion syntax, will see if I can find another way to do it (the @Q
is needed to quote the parameter).
@derschatta okay, that should be fixed now
This PR adds a tphp command for executing commands inside the php container.
Example:
This makes it a bit more convenient to use the install/cron/purge/etc aliases without needing to tbash in to the container.