updated django.manage so that if working dir is false, then the second section only gets executed under the elese, whereas if working dir was true, the second section got executed anyway

This commit is contained in:
ronny abraham 2023-08-10 22:46:14 +03:00
parent 4fbf259f69
commit c3f680d3c9

View file

@ -126,7 +126,9 @@ def manage(args="help", workingdir=None, prefix="", suffix=""):
from fabric.context_managers import cd
with virtualenv():
if workingdir:
with cd(workingdir):
fabcommand = "{prefix} {djangoroot}/manage.py {args} " \
"--pythonpath='{djangoroot}' " \
@ -147,6 +149,7 @@ def manage(args="help", workingdir=None, prefix="", suffix=""):
# MAKE SURE THIS IS ALWAYS HERE!
shell='/bin/bash')
else:
with cd(configuration.paths.django.root):
cmd = "{prefix} {djangoroot}/manage.py {args} " \
" --pythonpath='{djangoroot}' " \
@ -158,8 +161,11 @@ def manage(args="help", workingdir=None, prefix="", suffix=""):
suffix=suffix)
if env.debug:
print("command: with cd(%s)" % configuration.paths.django.root)
print("command: with cd(%s)" %
configuration.paths.django.root)
print("command: fabric_ops.run(%s)" % cmd)
else:
output = fabric_ops.run(