bin/cubicweb-ctl.bat
author Laurent Peuch <cortex@worlddomination.be>
Tue, 21 May 2019 16:36:12 +0200
changeset 12685 84a8a8915512
parent 5499 2a5cc708c2a0
permissions -rw-r--r--
[cubicweb-ctl] move to accepting only once instance name per command The rationals behind this decision are: - while in the past managing all instances sytem wide made a lot of sens, pratices have evolved today and we've moved to managing one instance by one - this makes things easier to debug since commands since using them on several instances were making this harder (errors hidden in the middle) - also solve the problem of the return code to have, before it was always 0 which prevented to do things like: ipython --pdb $(which cubicweb-ctl) $command $instance or shell scripts that used it - this simplify the code and is always good to take

@echo off
rem = """-*-Python-*- script
rem -------------------- DOS section --------------------
rem You could set PYTHONPATH or TK environment variables here
python -x "%~f0" %*
goto exit
 
"""
# -------------------- Python section --------------------
import sys
from os.path import join, dirname, normpath
sys.path.insert(0, normpath(join(dirname(__file__), '..', '..')))
from cubicweb.cwctl import run
run(sys.argv[1:])

DosExitLabel = """
:exit
rem """