Allow start scripts to have command-line flags
This commit is contained in:
parent
8ab3eca9ec
commit
3314b7d795
|
@ -1 +0,0 @@
|
|||
--listen
|
|
@ -64,4 +64,4 @@ source "$CONDA_ROOT_PREFIX/etc/profile.d/conda.sh" # otherwise conda complains a
|
|||
conda activate "$INSTALL_ENV_DIR"
|
||||
|
||||
# setup installer env
|
||||
python webui.py
|
||||
python webui.py $@
|
||||
|
|
|
@ -64,4 +64,4 @@ source "$CONDA_ROOT_PREFIX/etc/profile.d/conda.sh" # otherwise conda complains a
|
|||
conda activate "$INSTALL_ENV_DIR"
|
||||
|
||||
# setup installer env
|
||||
python webui.py
|
||||
python webui.py $@
|
||||
|
|
|
@ -67,7 +67,7 @@ set "CUDA_HOME=%CUDA_PATH%"
|
|||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
|
||||
|
||||
@rem setup installer env
|
||||
call python webui.py
|
||||
call python webui.py %*
|
||||
|
||||
@rem below are functions for the script next line skips these during normal execution
|
||||
goto end
|
||||
|
|
|
@ -5,7 +5,7 @@ cd /D "%~dp0"
|
|||
set PATH=%PATH%;%SystemRoot%\system32
|
||||
|
||||
@rem sed -i 's/\x0D$//' ./wsl.sh converts newlines to unix format in the wsl script
|
||||
call wsl -e bash -lic "sed -i 's/\x0D$//' ./wsl.sh; source ./wsl.sh"
|
||||
call wsl -e bash -lic "sed -i 's/\x0D$//' ./wsl.sh; source ./wsl.sh $@"
|
||||
|
||||
:end
|
||||
pause
|
||||
|
|
5
webui.py
5
webui.py
|
@ -245,7 +245,8 @@ def download_model():
|
|||
|
||||
|
||||
def launch_webui():
|
||||
run_cmd(f"python server.py {CMD_FLAGS}", environment=True)
|
||||
flags = [flag for flag in sys.argv[1:] if flag != '--update']
|
||||
run_cmd(f"python server.py {' '.join(flags)} {CMD_FLAGS}", environment=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -254,7 +255,7 @@ if __name__ == "__main__":
|
|||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--update', action='store_true', help='Update the web UI.')
|
||||
args = parser.parse_args()
|
||||
args, _ = parser.parse_known_args()
|
||||
|
||||
if args.update:
|
||||
update_dependencies()
|
||||
|
|
Loading…
Reference in New Issue