ePub: quote the command only on Windows.

This commit is contained in:
Thibaut Cuvelier 2021-02-07 06:27:07 +01:00
parent 4dcf3d56c2
commit 6a99e88565

View File

@ -46,7 +46,13 @@ if __name__ == '__main__':
print('Command to execute:') print('Command to execute:')
print(command) print(command)
if os.system('"' + command + '"') != 0: quoted_command = command
if os.name == 'nt':
# On Windows, it is typical to have spaces in folder names, and that requires to wrap the whole command
# in quotes. On Linux, this might create errors when starting the command.
quoted_command = '"' + command + '"'
if os.system(quoted_command) != 0:
print('docbook2epub fails') print('docbook2epub fails')
shutil.rmtree(output_dir, ignore_errors=True) shutil.rmtree(output_dir, ignore_errors=True)
sys.exit(1) sys.exit(1)