ubuntu: subprocess does not allow extended glob
It's my understanding that we cannot use extended globbing on Linux because of the way I am invoking the lang-extract script. the python script is not run through bash/shell. We would need to perhaps use Shell = True in check_call() but then the all the input arguments needs to be one string. This commit was tested on Ubuntu 22.04.1 LTS
This commit is contained in:
parent
327254d091
commit
280a904799
|
|
@ -53,20 +53,14 @@ def main():
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
print(error)
|
print(error)
|
||||||
|
|
||||||
# If operating system is Windows, then the script must expand
|
# Extend the glob and append all found files into FILE_LIST
|
||||||
# the regex expression with glob. On Linux and Mac, the operating
|
for pattern in SEARCH_PATHS:
|
||||||
# system takes care of expanding the glob for you. We only need to
|
for file in sorted(PO_DIR.glob(str(pattern))):
|
||||||
# do this manually on Windows.
|
FILE_LIST.append(file)
|
||||||
if sys.platform == "win32":
|
|
||||||
for pattern in SEARCH_PATHS:
|
|
||||||
for file in sorted(PO_DIR.glob(str(pattern))):
|
|
||||||
FILE_LIST.append(file)
|
|
||||||
|
|
||||||
# Convert the path to relative and use Posix format
|
# Convert the path to relative and use Posix format
|
||||||
for index, absolute_path in enumerate(FILE_LIST.copy()):
|
for index, absolute_path in enumerate(FILE_LIST.copy()):
|
||||||
FILE_LIST[index] = PurePosixPath(absolute_path).relative_to(PO_DIR)
|
FILE_LIST[index] = PurePosixPath(absolute_path).relative_to(PO_DIR)
|
||||||
else:
|
|
||||||
FILE_LIST = SEARCH_PATHS
|
|
||||||
|
|
||||||
# Run the lang-extract.py script
|
# Run the lang-extract.py script
|
||||||
SCRIPT_PATH = BASE_DIR.joinpath("lang-extract.py")
|
SCRIPT_PATH = BASE_DIR.joinpath("lang-extract.py")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue