Skip to content

Commit

Permalink
check self.options for working_directory and output_directory
Browse files Browse the repository at this point in the history
Signed-off-by: gorgobacka <[email protected]>
  • Loading branch information
gorgobacka committed Mar 27, 2019
1 parent 135cc9c commit 0602c15
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions whipper/command/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,19 @@ def do(self):
return -1

# Change working directory before cdrdao's task
if self.options.working_directory is not None:
if getattr(self.options, 'working_directory', False):
os.chdir(os.path.expanduser(self.options.working_directory))
out_bpath = self.options.output_directory.decode('utf-8')
# Needed to preserve cdrdao's tocfile
out_fpath = self.program.getPath(out_bpath,
self.options.disc_template,
self.mbdiscid,
self.program.metadata)

if hasattr(self.options, 'output_directory'):
out_bpath = self.options.output_directory.decode('utf-8')
# Needed to preserve cdrdao's tocfile
out_fpath = self.program.getPath(out_bpath,
self.options.disc_template,
self.mbdiscid,
self.program.metadata)
else:
out_fpath = None

# now, read the complete index table, which is slower
self.itable = self.program.getTable(self.runner,
self.ittoc.getCDDBDiscId(),
Expand Down

0 comments on commit 0602c15

Please sign in to comment.