mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] can do a 'yunohost tools shell -c command' à la python -c
This commit is contained in:
parent
52c7a37a78
commit
4e1a839557
2 changed files with 9 additions and 1 deletions
|
@ -1483,6 +1483,10 @@ tools:
|
||||||
configuration:
|
configuration:
|
||||||
authenticate: all
|
authenticate: all
|
||||||
action_help: Launch a development shell
|
action_help: Launch a development shell
|
||||||
|
arguments:
|
||||||
|
-c:
|
||||||
|
help: python command to execute
|
||||||
|
full: --command
|
||||||
|
|
||||||
### tools_shutdown()
|
### tools_shutdown()
|
||||||
shutdown:
|
shutdown:
|
||||||
|
|
|
@ -814,13 +814,17 @@ def tools_migrations_state():
|
||||||
return read_json(MIGRATIONS_STATE_PATH)
|
return read_json(MIGRATIONS_STATE_PATH)
|
||||||
|
|
||||||
|
|
||||||
def tools_shell(auth):
|
def tools_shell(auth, command=None):
|
||||||
"""
|
"""
|
||||||
Launch an (i)python shell in the YunoHost context.
|
Launch an (i)python shell in the YunoHost context.
|
||||||
|
|
||||||
This is entirely aim for development.
|
This is entirely aim for development.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if command:
|
||||||
|
exec(command)
|
||||||
|
return
|
||||||
|
|
||||||
logger.warn("The \033[1;34mauth\033[0m is available in this context")
|
logger.warn("The \033[1;34mauth\033[0m is available in this context")
|
||||||
try:
|
try:
|
||||||
from IPython import embed
|
from IPython import embed
|
||||||
|
|
Loading…
Add table
Reference in a new issue