Let RARCOMMAND take path and create derivatives by itself.

This commit is contained in:
voussoir 2020-08-23 22:17:50 -07:00
parent 983d4ddc1e
commit 2fc55ee330

View file

@ -20,8 +20,8 @@ class NotEnoughSpace(RarParException):
pass
def RARCOMMAND(
path,
basename,
input_pattern,
workdir,
password=None,
rec=None,
@ -67,6 +67,11 @@ def RARCOMMAND(
if password is not None:
command.append(f'-hp{password}')
if path.is_dir:
input_pattern = path.absolute_path + '\\*'
else:
input_pattern = path.absolute_path
command.append(f'"{workdir.absolute_path}{os.sep}{basename}.rar"')
command.append(f'"{input_pattern}"')
@ -234,11 +239,6 @@ def rarpar(
path.assert_exists()
if path.is_dir:
input_pattern = path.absolute_path + '\\*'
else:
input_pattern = path.absolute_path
workdir = pathclass.Path(workdir)
workdir.assert_is_directory()
@ -278,8 +278,8 @@ def rarpar(
script = []
rarcommand = RARCOMMAND(
path=path,
basename=basename,
input_pattern=input_pattern,
password=password,
rec=rec,
rev=rev,