Normalize cmd arg paths

In particular, this fixes an issue on Windows where some functions
will misbehave if forward slashes are provided rather than
double backslashes.
This commit is contained in:
catboxanon
2024-02-15 14:22:13 -05:00
parent b7f45e67dc
commit 06ab10a1be
3 changed files with 27 additions and 22 deletions

View File

@@ -4,6 +4,10 @@ import argparse
import os
import sys
import shlex
from pathlib import Path
normalized_filepath = lambda filepath: str(Path(filepath).resolve())
commandline_args = os.environ.get('COMMANDLINE_ARGS', "")
sys.argv += shlex.split(commandline_args)