mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
fish plugin: Assign the default output path to the option instead of using None
This commit is contained in:
parent
b46b4d2045
commit
fedb8b0b8f
1 changed files with 3 additions and 8 deletions
|
|
@ -84,7 +84,7 @@ class FishPlugin(BeetsPlugin):
|
||||||
cmd.parser.add_option(
|
cmd.parser.add_option(
|
||||||
'-o',
|
'-o',
|
||||||
'--output',
|
'--output',
|
||||||
default=None,
|
default='~/.config/fish/completions/beet.fish',
|
||||||
help='save the script to a specific file, by default it will be'
|
help='save the script to a specific file, by default it will be'
|
||||||
'saved to ~/.config/fish/completions')
|
'saved to ~/.config/fish/completions')
|
||||||
return [cmd]
|
return [cmd]
|
||||||
|
|
@ -96,13 +96,8 @@ class FishPlugin(BeetsPlugin):
|
||||||
# Make a giant string of all the above, formatted in a way that
|
# Make a giant string of all the above, formatted in a way that
|
||||||
# allows Fish to do tab completion for the `beet` command.
|
# allows Fish to do tab completion for the `beet` command.
|
||||||
|
|
||||||
completion_file_path = opts.output
|
completion_file_path = os.path.expanduser(opts.output)
|
||||||
if completion_file_path is not None:
|
completion_dir = os.path.dirname(completion_file_path)
|
||||||
completion_dir = os.path.dirname(completion_file_path)
|
|
||||||
else:
|
|
||||||
home_dir = os.path.expanduser("~")
|
|
||||||
completion_dir = os.path.join(home_dir, '.config/fish/completions')
|
|
||||||
completion_file_path = os.path.join(completion_dir, 'beet.fish')
|
|
||||||
|
|
||||||
if completion_dir != '':
|
if completion_dir != '':
|
||||||
os.makedirs(completion_dir, exist_ok=True)
|
os.makedirs(completion_dir, exist_ok=True)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue